How to call first time operation when user install the my app

zilehuda
Tourist
17 0 2

So I would perform certain operations whenever the user installs my app for the first time.

In which part in my node app, I should put this code?

Note: Code will be run only once when a user installs the app, I've created an app using shopify node create.

Replies 2 (2)

mkamalkayani
Shopify Partner
87 8 15

In the afterAuth function, the same place were uninstall webhook is registered. You can check if the shop exists in the db or not, if it does not exist then it's first time install.

John77777
Shopify Partner
2 0 0

Is the afterAuth function still available?  I can't find it in their webhook documentation https://shopify.dev/docs/api/admin-rest/2023-10/resources/webhook