Have your say in Community Polls: What was/is your greatest motivation to start your own business?
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Install custom app link doesn't allow additional parameters

Install custom app link doesn't allow additional parameters

chriszirkel
Shopify Partner
7 0 1

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? 

Replies 3 (3)

AndySlack
Shopify Partner
6 0 0

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?

AndySlack
Shopify Partner
6 0 0
chriszirkel
Shopify Partner
7 0 1

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.