useIntent
Parses an intent passed to the Mini via deeplink, following the Shopify Intents API URI format (action:type,value). Returns the parsed query (action, type, value) and optional data payload. Use this hook to receive intents from the host app (Host → Mini direction), for example when the Shop app launches a Mini to handle a virtual try-on for a specific product.
Anchor to useIntentuse Intent()
Anchor to useIntent-returnsReturns
UseIntentReturn
- data
Additional JSON data passed with the intent, or null
{[key: string]: unknown} | null - query
Parsed intent query, or null if no intent was passed
IntentQuery | null
IntentQuery
Structured description of an intent, following the Shopify Intents API URI format: `action:type,value`
- action
Verb describing the operation (e.g., 'try_on', 'create', 'edit')
string - type
Resource type identifier (e.g., 'shopify/Product', 'shop/UserImage')
string - value
Resource GID (e.g., 'gid://shopify/Product/123') if applicable
string | null