A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
The installation of a custom app must go through the generated installation link from Shopify Partners Dashboard. This has the disadvantage that I can't add any additional parameters to the link that will be forwarded to my app, so that after successful installation (authentication) my app can redirect the user with these parameters.
Is there any way I can pass parameters or state along the auth request that I will get back from Shopify after successful authentication?
I am also wondering the same thing... How do we kick off the install, passing a state item for example so we can match back the user who is installing the app on our own system?
Finally got this working, you can see the code here: https://github.com/juicyllama/framework/blob/main/apps/shopify/src/modules/auth/auth.controller.ts
Hi @AndySlack
thanks for your reply! It looks like you're using building a public app. In this case, you can construct the install url manually like you did it here:
const redirect = `https://${
installed_app.settings.SHOPIFY_SHOP_NAME
}.myshopify.com/admin/oauth/authorize?client_id=${this.configService.get<string>(
'shopify.SHOPIFY_APP_CLIENT_ID',
)}&scope=${ShopifyAuthScopes.toString()}&redirect_uri=${
process.env.BASE_URL_API
}${ShopifyAuthRedirect}&state=${state}`
Custom apps, on the other hand, must be installed with a link that's generated from the Partner Dashboard: https://shopify.dev/docs/apps/distribution/select-distribution-method#install-a-custom-app-on-multip...
The install url for custom apps looks like this:
https://SHOP.myshopify.com/admin/oauth/install_custom_app?client_id=CLIENT_ID&signature=SIGNATURE
Any additional query parameters will not be returned from the redirect.