Shopify Minis: Optional Consent, New Hooks, and Intents
Implement useCheckScopesConsent to conditionally render features based on granted scopes and handle request_blocked to avoid blocking the Mini.
Update your Minis to use useCheckScopesConsent for feature gating, handle request_blocked in the UI, and add useRequestScopesConsent for re‑request flows.
Summary
Shopify Minis now support optional consent, allowing users to reject individual scopes without blocking the entire Mini. The new useCheckScopesConsent hook lets Minis check at runtime which scopes a user has granted and render features conditionally. The useRequestScopesConsent hook can re‑request a declined scope from a user interaction, but cannot be called automatically. The useCheckPermissions hook checks OS‑level permissions such as camera or photo library before performing an action.
When a scope or permission is declined and the platform will not re‑prompt, the hooks return a request_blocked sentinel instead of null, enabling the Mini to distinguish between “not asked yet” and “asked and blocked.” Shopify also introduces an intents communication layer, letting the Shop app launch a Mini with contextual data such as a product, opening new distribution paths beyond the Explore tab. Two intents are supported today, though the table in the release notes is incomplete. Minis should be updated to use the new hooks and handle the request_blocked state to provide a graceful user experience.
Key changes
- Optional consent allows users to decline individual scopes.
- useCheckScopesConsent hook returns granted scopes at runtime.
- useRequestScopesConsent hook re‑requests declined scopes from a user interaction.
- useCheckPermissions hook checks OS‑level permissions before actions.
- Hooks now return request_blocked sentinel when a scope or permission is declined and cannot be re‑prompted.
- Intents layer lets the Shop app launch Minis with contextual data like a product.
- Two intents are supported in the preview.