Skip to main content

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.

When your Mini finishes handling the intent, use useResolveIntent to send the result back to the Shop app.

Examples

tsx

import {useEffect} from 'react'
import {useIntent} from '@shopify/shop-minis-react'

export default function MyMini() {
const {query, data} = useIntent()

const {action, type, value} = query ?? {}

useEffect(() => {
if (action === 'try_on' && value) {
// Navigate to try-on screen with the product GID
console.log(`Try on ${type}:`, value, data)
}
}, [query, data])
}


Was this page helpful?