Best practice to implement app upgrades requiring additional API scopes

Best practice to implement app upgrades requiring additional API scopes

user072319
Shopify Partner
131 0 17

We have a live Shopify app and we are regularly upgrading the app with new features that sometimes requires new API scopes.

 

a. Is there a way to implement new scopes without the store owner having to constantly approve the new scopes?

b. Will Shopify automatically asks the store owner to update the app(as shown in below image) if any scope is newly added?

 

app_scope.png

Reply 1 (1)

Brooklynite
Shopify Partner
4 0 1

a. Is there a way to implement new scopes without the store owner having to constantly approve the new scopes?

Approval isn't needed for every scope. Sometimes you don't need approval, sometimes you need owner approval and sometimes you need Shopify's approval. Look here for a full list and it's requirements: https://shopify.dev/api/usage/access-scopes

 

 

>b. Will Shopify automatically asks the store owner to update the app(as shown in below image) if any scope is newly added?

Yes they will. However, when the user has an active session you will have to force a reload. And make sure that reloaded page checks for a valid OAth token. If you don't do that then certain API calls might fail and could generate a server error. Alternatively you could catch the error and display a request to the user to reload the page themselves.

 

Good luck!