Tags:
- Admin GraphQL API
- 2024-10
Configure optional scopes for Shopify apps
Apps on Admin API version 2024-10
can use the new app configuration to:
- Separate required scopes from optional
- Request unique sets of access scopes on a store-by-store basis
- Revoke optional scopes granted to the app from a store
- Request and revoke scopes in-context, at app runtime
All while taking advantage of Shopify managed install.
Declaring optional scopes
In your app configuration, specify optional scopes that your app may request, in addition to your app’s required scopes
:
[access_scopes]
scopes = "read_products"
optional_scopes = [ "write_products", "read_discounts", "read_themes" ]
Requesting, revoking, and querying optional scopes at runtime
With optional scopes, apps can prompt merchants to grant their app access either from a server-side API, or from a client-side App Bridge API for a more integrated experience. See our documentation on how to request access scopes dynamically for details.
Granted optional scopes can be dynamically revoked from stores by apps. Our APIs supply a revoke
method for this, and we also provide a GraphQL mutation.
With optional scopes, apps may need to know which scopes are granted on the current store. We supply a query
method that lists the granted scopes on the store. Apps can also manually query the field on the
object.
Learn more
To learn more about optional scopes, see our documentation on how to manage access scopes. See also our client-side App Bridge Scopes API, and our server-side Remix Scopes API.