Ecommerce Shopify WordPress Discussion

Where to add custom code that will execute after the user installs the shopify app?

I'm attempting to generate new metafield definitions after the user accepts the app installation. However, I'm having a hard time determining where to place my code for generating the definitions. Currently I'm using Remix Template using nodejs in my APP. Upon my investigation, the following are called during the app installation process: The afterAuth hook, which can be found in the app/shopify.server.ts file. Creating a route for auth/callback (I created this file: app/routes/auth.callback/route.tsx). On the app/routes/auth.$.tsx route. I'm unsure which of the above options is best to use for (3) or if it's recommended to use any of the options mentioned. Could someone guide me in the right direction?
AfterAuth is the right place. Usually your framework will call that job for you, meaning you just have to write the code to get the auth token, and then make your API call. note that this pattern is a PITA though, because reliance on it means you can't fiddle so easily with it after the fact and have all stores run your new code. It is only on after auth, which in many cases is never called after install. My silly workaround that was always to force an auth with the /login route but that is bush league IMO for lack of a better way.

February 13, 2024

TurboCommerce make the better internet purchasing globaly

Turbo Multi-language Translator

Make the better internet purchasing globaly

Turbosify SEO Speed Booster

5.0 (7) Free plan available
Get better conversions by improving store loading speed Installed

Turbo Multi-language Chat - AI Customer service in one hand

TurboCommerce make the better internet purchasing globaly
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.