use Error Toast
The useErrorToast hook displays a non-blocking error notification. Use this for recoverable errors, warnings, or informational messages that don't prevent users from continuing their workflow. The toast appears temporarily at the top or bottom of the screen, auto-dismisses, and allows users to keep interacting with the Mini.
Use useErrorToast for recoverable errors or warnings (e.g., failed to save preference, item out of stock, temporary network issues, validation errors). This shows a non-blocking notification that auto-dismisses and doesn't interrupt the user's current task. Use useErrorScreen for critical failures that block the user workflow (e.g., authentication failures, data corruption, network timeouts that prevent the app from functioning). This provides a full-screen error UI that the user must acknowledge before continuing.
Use useErrorToast for recoverable errors or warnings (e.g., failed to save preference, item out of stock, temporary network issues, validation errors). This shows a non-blocking notification that auto-dismisses and doesn't interrupt the user's current task. Use useErrorScreen for critical failures that block the user workflow (e.g., authentication failures, data corruption, network timeouts that prevent the app from functioning). This provides a full-screen error UI that the user must acknowledge before continuing.
Anchor to useErrorToastuse Error Toast()
UseErrorToastReturns
- showErrorToast
Show an error toast with the given error message.
ShopActions
ShopActions
{
[K in keyof ShopActionEvents as SnakeToCamelCase<K>]: ShopActionEvents[K]
}ShopActionEvents
- ADD_PRODUCT_LIST
ShopAction<AddProductListParams, ProductList> - ADD_PRODUCT_LIST_ITEM
ShopAction<AddProductListItemParams, void> - ADD_TO_CART
ShopAction<AddToCartParams, void> - BUY_PRODUCT
ShopAction<BuyProductParams, void> - BUY_PRODUCTS
ShopAction<BuyProductsParams, void> - CHECK_PERMISSION
ShopAction<CheckPermissionParams, CheckPermissionResponse> - CHECK_SCOPES_CONSENT
ShopAction< CheckScopesConsentParams, {data: CheckScopesConsentResponse} > - CLEAR_INTERNAL_PERSISTED_ITEMS
ShopAction<void, void> - CLEAR_PERSISTED_ITEMS
ShopAction<void, void> - CLOSE_MINI
ShopAction<void, void> - COMPLETE_IMAGE_UPLOAD
ShopAction< CompleteImageUploadParams, CompleteImageUploadResponse > - CREATE_CONTENT
ShopAction<CreateContentParams, CreateContentResponse> - CREATE_IMAGE_UPLOAD_LINK
ShopAction< CreateImageUploadLinkParams, CreateImageUploadLinkResponse > - CREATE_ORDER_ATTRIBUTION
ShopAction<CreateOrderAttributionParams, void> - FAVORITE
ShopAction<FavoriteParams, void> - FOLLOW_SHOP
ShopAction<FollowShopParams, boolean> - GENERATE_USER_TOKEN
ShopAction<void, GenerateUserTokenResponse> - GET_ACCOUNT_INFORMATION
ShopAction< GetAccountInformationParams, GetAccountInformationResponse > - GET_ALL_INTERNAL_PERSISTED_KEYS
ShopAction<void, string[]> - GET_ALL_PERSISTED_KEYS
ShopAction<void, string[]> - GET_BUYER_ATTRIBUTES
ShopAction< GetBuyerAttributesParams, GetBuyerAttributesResponse > - GET_CONTENT
ShopAction<GetContentParams, GetContentResponse> - GET_CURRENT_USER
ShopAction<GetCurrentUserParams, GetCurrentUserResponse> - GET_DEEPLINK_PATHS
ShopAction<void, GetDeeplinkPathsResponse> - GET_FOLLOWED_SHOPS
ShopAction< GetFollowedShopsParams, GetFollowedShopsResponse > - GET_INTERNAL_PERSISTED_ITEM
ShopAction< GetAsyncStorageItemParams, string | null > - GET_ORDERS
ShopAction<GetOrdersParams, GetOrdersResponse> - GET_PERSISTED_ITEM
ShopAction<GetAsyncStorageItemParams, string | null> - GET_POPULAR_PRODUCTS
ShopAction< GetPopularProductsParams, GetPopularProductsResponse > - GET_PRODUCT
ShopAction<GetProductParams, GetProductResponse> - GET_PRODUCT_LIST
ShopAction<GetProductListParams, GetProductListResponse> - GET_PRODUCT_LISTS
ShopAction<GetProductListsParams, GetProductListsResponse> - GET_PRODUCT_MEDIA
ShopAction<GetProductMediaParams, GetProductMediaResponse> - GET_PRODUCT_REVIEWS
ShopAction< GetProductReviewsParams, GetProductReviewsResponse > - GET_PRODUCT_SEARCH
ShopAction< GetProductSearchParams, GetProductSearchResponse > - GET_PRODUCT_VARIANTS
ShopAction< GetProductVariantsParams, GetProductVariantsResponse > - GET_PRODUCTS
ShopAction<GetProductsParams, GetProductsResponse> - GET_RECENT_PRODUCTS
ShopAction< GetRecentProductsParams, GetRecentProductsResponse > - GET_RECENT_SHOPS
ShopAction<GetRecentShopsParams, GetRecentShopsResponse> - GET_RECOMMENDED_PRODUCTS
ShopAction< GetRecommendedProductsParams, GetRecommendedProductsResponse > - GET_RECOMMENDED_SHOPS
ShopAction< GetRecommendedShopsParams, GetRecommendedShopsResponse > - GET_SAVED_PRODUCTS
ShopAction< GetSavedProductsParams, GetSavedProductsResponse > - GET_SECRET
ShopAction<void, string | null> - GET_SHOP
ShopAction<GetShopParams, GetShopResponse> - GET_SHOP_APP_INFORMATION
ShopAction<void, GetShopAppInformationResponse> - GET_SHOPS_WITH_DISCOUNTS
ShopAction< GetShopsWithDiscountsParams, GetShopsWithDiscountsResponse > - GET_SIMILAR_PRODUCTS
ShopAction< GetSimilarProductsParams, GetSimilarProductsResponse > - INVOKE_INTENT
ShopAction<InvokeIntentParams, InvokeIntentResponse> - NAVIGATE_TO_CART
ShopAction<void, void> - NAVIGATE_TO_CHECKOUT
ShopAction<NavigateToCheckoutParams, void> - NAVIGATE_TO_DEEPLINK
ShopAction<NavigateToDeeplinkParams, void> - NAVIGATE_TO_ORDER
ShopAction<NavigateToOrderParams, void> - NAVIGATE_TO_PRODUCT
ShopAction<NavigateToProductParams, void> - NAVIGATE_TO_SHOP
ShopAction<NavigateToShopParams, void> - PREVIEW_PRODUCT_IN_AR
ShopAction<PreviewProductInARParams, void> - PRODUCT_RECOMMENDATION_CLICK
ShopAction< ProductRecommendationClickParams, void > - PRODUCT_RECOMMENDATION_IMPRESSION
ShopAction< ProductRecommendationImpressionParams, void > - REMOVE_INTERNAL_PERSISTED_ITEM
ShopAction<RemoveAsyncStorageItemParams, void> - REMOVE_PERSISTED_ITEM
ShopAction<RemoveAsyncStorageItemParams, void> - REMOVE_PRODUCT_LIST
ShopAction<RemoveProductListParams, void> - REMOVE_PRODUCT_LIST_ITEM
ShopAction<RemoveProductListItemParams, void> - REMOVE_SECRET
ShopAction<void, void> - RENAME_PRODUCT_LIST
ShopAction<RenameProductListParams, ProductList> - REPORT_CONTENT_IMPRESSION
ShopAction<ReportContentImpressionParams, void> - REPORT_ERROR
ShopAction<ReportErrorParams, void> - REPORT_FETCH
ShopAction<ReportFetchParams, void> - REPORT_IMPRESSION
ShopAction<ReportImpressionParams, void> - REPORT_INTERACTION
ShopAction<ReportInteractionParams, void> - REQUEST_PERMISSION
ShopAction< RequestPermissionParams, RequestPermissionResponse > - REQUEST_SCOPES_CONSENT
ShopAction<void, RequestScopesConsentResponse> - RESOLVE_INTENT
ShopAction<ResolveIntentParams, void> - SEARCH_PRODUCTS_BY_SHOP
ShopAction< SearchProductsByShopParams, SearchProductsByShopResponse > - SET_INTERNAL_PERSISTED_ITEM
ShopAction<SetAsyncStorageItemParams, void> - SET_PERSISTED_ITEM
ShopAction<SetAsyncStorageItemParams, void> - SET_PRODUCT_LIST_VISIBILITY
ShopAction< SetProductListVisibilityParams, ProductList > - SET_SECRET
ShopAction<SetSecretParams, void> - SHARE
ShopAction<ShareParams, ShareResponse> - SHARE_SINGLE
ShopAction<ShareSingleParams, ShareSingleResponse> - SHOW_ERROR_SCREEN
ShopAction<ShowErrorScreenParams, void> - SHOW_ERROR_TOAST
ShopAction<ShowErrorToastParams, void> - SHOW_FEEDBACK_SHEET
ShopAction<ShowFeedbackSheetParams, void> - TRANSLATE_CONTENT_DOWN
ShopAction<void, void> - TRANSLATE_CONTENT_UP
ShopAction<TranslateContentUpParams, void> - UNFAVORITE
ShopAction<UnfavoriteParams, void> - UNFOLLOW_SHOP
ShopAction<UnfollowShopParams, boolean>
ShopAction
A generic type representing any action in ShopActions. - N: The name of the action (string literal type) - P: The params type for the action - R: The result type for the action
- params
P
Promise<ShopActionResult<R>>ShopActionResult
ShopActionOk<T> | ShopActionErrorShopActionOk
- data
T - mocked
boolean - ok
true
ShopActionError
- error
Error & { code?: string; } - mocked
boolean - ok
false
AddProductListParams
- description
A description of the product list.
string - name
The name of the product list.
string - privacyStatus
The privacy status of the product list. Defaults to 'PRIVATE'.
ProductListPrivacyStatus
ProductListPrivacyStatus
'PRIVATE' | 'PUBLIC'ProductList
- id
string - name
string | null - privacyStatus
ProductListPrivacyStatus - products
Product[] - publicId
string | null
Product
- compareAtPrice
Money | null - defaultVariantId
string - featuredImage
ProductImage | null - id
string - isFavorited
boolean - options
The product's configurable options (e.g. Color, Size). Optional for backwards compatibility with products returned by older Shop app hosts; treat as `[]` when undefined.
ProductOption[] - price
Money - referral
boolean - reviewAnalytics
{ averageRating?: number; reviewCount?: number; } - selectedVariant
ProductVariant - shop
ProductShop - title
string - variants
ProductVariant[]
Money
- amount
Decimal - currencyCode
CurrencyCode
Decimal
stringCurrencyCode
'AED' | 'AFN' | 'ALL' | 'AMD' | 'ANG' | 'AOA' | 'ARS' | 'AUD' | 'AWG' | 'AZN' | 'BAM' | 'BBD' | 'BDT' | 'BGN' | 'BHD' | 'BIF' | 'BMD' | 'BND' | 'BOB' | 'BRL' | 'BSD' | 'BTN' | 'BWP' | 'BYN' | 'BYR' | 'BZD' | 'CAD' | 'CDF' | 'CHF' | 'CLP' | 'CNY' | 'COP' | 'CRC' | 'CVE' | 'CZK' | 'DJF' | 'DKK' | 'DOP' | 'DZD' | 'EGP' | 'ERN' | 'ETB' | 'EUR' | 'FJD' | 'FKP' | 'GBP' | 'GEL' | 'GHS' | 'GIP' | 'GMD' | 'GNF' | 'GTQ' | 'GYD' | 'HKD' | 'HNL' | 'HRK' | 'HTG' | 'HUF' | 'IDR' | 'ILS' | 'INR' | 'IQD' | 'IRR' | 'ISK' | 'JEP' | 'JMD' | 'JOD' | 'JPY' | 'KES' | 'KGS' | 'KHR' | 'KID' | 'KMF' | 'KRW' | 'KWD' | 'KYD' | 'KZT' | 'LAK' | 'LBP' | 'LKR' | 'LRD' | 'LSL' | 'LTL' | 'LVL' | 'LYD' | 'MAD' | 'MDL' | 'MGA' | 'MKD' | 'MMK' | 'MNT' | 'MOP' | 'MRU' | 'MUR' | 'MVR' | 'MWK' | 'MXN' | 'MYR' | 'MZN' | 'NAD' | 'NGN' | 'NIO' | 'NOK' | 'NPR' | 'NZD' | 'OMR' | 'PAB' | 'PEN' | 'PGK' | 'PHP' | 'PKR' | 'PLN' | 'PYG' | 'QAR' | 'RON' | 'RSD' | 'RUB' | 'RWF' | 'SAR' | 'SBD' | 'SCR' | 'SDG' | 'SEK' | 'SGD' | 'SHP' | 'SLL' | 'SOS' | 'SRD' | 'SSP' | 'STD' | 'STN' | 'SYP' | 'SZL' | 'THB' | 'TJS' | 'TMT' | 'TND' | 'TOP' | 'TRY' | 'TTD' | 'TWD' | 'TZS' | 'UAH' | 'UGX' | 'USD' | 'UYU' | 'UZS' | 'VED' | 'VEF' | 'VES' | 'VND' | 'VUV' | 'WST' | 'XAF' | 'XCD' | 'XOF' | 'XPF' | 'XXX' | 'YER' | 'ZAR' | 'ZMW'ProductImage
- altText
string | null - height
number | null - id
string | null - sensitive
boolean | null - thumbhash
string | null - url
string - width
number | null
ProductOption
A configurable product option (e.g. Color, Size) and the set of values it accepts across all variants.
- id
Globally-unique identifier for the option.
string - name
The display name of the option. E.g. `Color`.
string - values
All possible values for the option across variants. E.g. `['Red', 'Blue']`.
string[]
ProductVariant
- availableForSale
Whether the variant can be purchased. When `false`, calls to add the variant to cart or buy it through the SDK will fail. UI should be gated on this flag. May be `undefined` if the variant was sourced from an API that does not expose stock state.
boolean - compareAtPrice
Money | null - id
string - image
ProductImage | null - isFavorited
boolean - price
Money - selectedOptions
The (name, value) pairs of product options this variant corresponds to. E.g. `[{name: 'Color', value: 'Green'}, {name: 'Size', value: 'M'}]`. Optional for backwards compatibility with variants returned by older Shop app hosts; treat as `[]` when undefined.
ProductSelectedOption[] - title
string
ProductSelectedOption
A single (name, value) pair that identifies which value of a product option a variant corresponds to. E.g. `{name: 'Color', value: 'Green'}`.
- name
string - value
string
ProductShop
- id
string - name
string
AddProductListItemParams
- listId
The GID of the product list. E.g. `gid://shopapp/ProductList/123`. This will soon be deprecated in favor of just `publicListId`.
string - productId
The GID of the product. E.g. `gid://shopify/Product/123`.
string - productVariantId
The GID of the product variant. E.g. `gid://shopify/ProductVariant/101`.
string - publicListId
The public ID of the product list.
string - shopId
The GID of the shop. E.g. `gid://shopify/Shop/42`.
string
AddToCartParams
- attribution
Attribution data for the line item.
LineItemAttribution - discountCodes
The discount codes to apply to the cart.
string[] - productId
The GID of the product. E.g. `gid://shopify/Product/123`.
string - productVariantId
The GID of the product variant. E.g. `gid://shopify/ProductVariant/456`.
string - quantity
The quantity of the product to add to the cart.
number - variantImageUrl
The URL of the variant image.
string
LineItemAttribution
- sourceIdentifier
string - sourceName
string
BuyProductParams
- attribution
Attribution data for the line item.
LineItemAttribution - discountCode
The discount code to apply to the product.
string - productId
The GID of the product. E.g. `gid://shopify/Product/123`.
string - productVariantId
The GID of the product variant. E.g. `gid://shopify/ProductVariant/456`.
string - quantity
The quantity of the product to add to the cart.
number
BuyProductsParams
- attribution
LineItemAttribution - discountCode
string - items
[BuyProductLineItem, ...BuyProductLineItem[]]
BuyProductLineItem
- productId
The GID of the product. E.g. `gid://shopify/Product/123`.
string - productVariantId
The GID of the product variant. E.g. `gid://shopify/ProductVariant/456`.
string - quantity
The quantity of the product to add to the cart.
number
CheckPermissionParams
- permission
MiniPermission
MiniPermission
'CAMERA' | 'MICROPHONE' | 'MOTION'CheckPermissionResponse
- errorMessage
string - status
PermissionStatus
PermissionStatus
The current state of a permission for the Mini. - `granted`: The user has approved the in-app consent dialog and the OS has granted the permission. - `denied`: The user has previously denied the permission, either in the in-app consent dialog or at the OS level. The permission can still be requested again. - `blocked`: The permission is blocked at the OS level. The user must enable it from device settings. - `undetermined`: The user has not yet been shown the in-app consent dialog for this permission. - `unavailable`: The permission is not declared in the Mini's manifest, or the feature is not available on this device.
'granted' | 'denied' | 'blocked' | 'undetermined' | 'unavailable'CheckScopesConsentParams
- fetchPolicy
DataHookFetchPolicy
DataHookFetchPolicy
'cache-first' | 'network-only'CheckScopesConsentResponse
- grantedScopes
string[] - requiredScopes
string[] - status
'granted' | 'partially_granted' | 'not_granted'
CompleteImageUploadParams
- resourceUrls
string[]
CompleteImageUploadResponse
- error
string - files
{ id: string; fileStatus: "FAILED" | "PENDING" | "PROCESSING" | "READY"; image?: { url: string; }; }[]
CreateContentParams
- description
string - externalId
string - imageUrl
string - productIds
string[] - title
string - visibility
ContentVisibility[] | null
ContentVisibility
'DISCOVERABLE' | 'LINKABLE'CreateContentResponse
- data
Content - userErrors
ContentCreateUserErrors[]
Content
- description
string | null - externalId
string | null - image
ContentImage - products
ContentProduct[] | null - publicId
string - shareableUrl
string | null - status
MinisContentStatus | null - title
string - visibility
ContentVisibility[]
ContentImage
- altText
string | null - height
number | null - id
string | null - thumbhash
string | null - url
string - width
number | null
ContentProduct
- featuredImage
ContentImage | null - id
string - title
string
MinisContentStatus
- PENDING
PENDING - READY
READY - REJECTED
REJECTED
ContentCreateUserErrors
- code
ContentCreateUserErrorCode - message
string
ContentCreateUserErrorCode
- DUPLICATE_EXTERNAL_ID
DUPLICATE_EXTERNAL_ID - INELIGIBLE_PRODUCTS
INELIGIBLE_PRODUCTS
CreateImageUploadLinkParams
- input
{ mimeType: string; fileSize: number; }[]
CreateImageUploadLinkResponse
- error
string - targets
UploadTarget[]
UploadTarget
- parameters
{ name: string; value: string; }[] - resourceUrl
string - url
string
CreateOrderAttributionParams
- attribution
LineItemAttribution - orderId
string - productVariantId
string
FavoriteParams
- productId
string - productVariantId
string - shopId
string
FollowShopParams
- shopId
string
GenerateUserTokenResponse
- data
GeneratedTokenData - userErrors
UserTokenGenerateUserErrors[]
GeneratedTokenData
- expiresAt
The expiration time of the token.
ISO8601DateTime | null - token
A temporary token for the user.
string | null - userState
Whether the user is verified or a guest.
UserState | null
ISO8601DateTime
stringUserState
- GUEST
GUEST - VERIFIED
VERIFIED
UserTokenGenerateUserErrors
- code
UserTokenGenerateUserErrorCode - field
string[] | null - message
string
UserTokenGenerateUserErrorCode
- MINI_NOT_FOUND
MINI_NOT_FOUND - USER_NOT_FOUND
USER_NOT_FOUND
GetAccountInformationParams
- shopId
To use user account information, a shopId must be given to track on which shop's behalf user information is being accessed
string - type
'email' | 'name' | 'phone'
GetAccountInformationResponse
- status
'available' | 'not-available' - value
string | AccountInformationPhoneInfo
AccountInformationPhoneInfo
- countryCode
string - phoneNumber
string - prefix
string
GetBuyerAttributesParams
- fetchPolicy
DataHookFetchPolicy
GetBuyerAttributesResponse
- data
{ genderAffinity?: Gender; categoryAffinities: TaxonomyCategory[]; }
Gender
'MALE' | 'FEMALE' | 'NEUTRAL'TaxonomyCategory
- ancestors
TaxonomyCategory[] - id
string - name
string
GetContentParams
- fetchPolicy
DataHookFetchPolicy - identifiers
ContentIdentifierInput | ContentIdentifierInput[]
ContentIdentifierInput
- externalId
string | null - publicId
string | null
GetContentResponse
- data
Content[]
GetCurrentUserParams
- fetchPolicy
DataHookFetchPolicy
GetCurrentUserResponse
- data
UserProfile
UserProfile
- avatarImage
{ url: string } | null - displayName
string | null
GetDeeplinkPathsResponse
- matchers
string[]
GetFollowedShopsParams
- after
string - fetchPolicy
DataHookFetchPolicy - first
number
GetFollowedShopsResponse
- data
T - pageInfo
PaginationInfo
PaginationInfo
- endCursor
string | null - hasNextPage
boolean
GetAsyncStorageItemParams
- key
string
GetOrdersParams
- after
string - fetchPolicy
DataHookFetchPolicy - first
number
GetOrdersResponse
- data
T - pageInfo
PaginationInfo
GetPopularProductsParams
- after
string - fetchPolicy
DataHookFetchPolicy - first
number
GetPopularProductsResponse
- data
T - pageInfo
PaginationInfo
GetProductParams
- fetchPolicy
DataHookFetchPolicy - id
string
GetProductResponse
- data
Product
GetProductListParams
- after
The cursor to fetch the next page of items.
string - fetchPolicy
The fetch policy to use.
DataHookFetchPolicy - first
The number of items to fetch.
number - id
The GID of the product list. E.g. `gid://shopapp/ProductList/123`.
string - publicId
The public ID of the product list.
string
GetProductListResponse
- data
T - pageInfo
PaginationInfo
GetProductListsParams
- after
The cursor to fetch the next page of lists.
string - fetchPolicy
The fetch policy to use.
DataHookFetchPolicy - first
The number of lists to fetch.
number - itemsFirst
The number of items per list to fetch.
number
GetProductListsResponse
- data
T - pageInfo
PaginationInfo
GetProductMediaParams
- after
string - fetchPolicy
DataHookFetchPolicy - first
number - id
string
GetProductMediaResponse
- data
T - pageInfo
PaginationInfo
GetProductReviewsParams
- after
string - fetchPolicy
DataHookFetchPolicy - first
number - id
string
GetProductReviewsResponse
- data
T - pageInfo
PaginationInfo
GetProductSearchParams
- after
string - fetchPolicy
DataHookFetchPolicy - filters
ProductFilters - first
number - includeSensitive
boolean - query
string - sortBy
ProductSearchSortBy
ProductFilters
- apparelSize
ProductApparelSizeFilter[] - available
boolean - category
string[] - color
ProductColorFilter[] - gender
'MALE' | 'FEMALE' | 'NEUTRAL' - includeShopIds
string[] - minimumRating
number - price
{ min?: number; max?: number; } - shoeSize
ProductShoeSizeFilter[]
ProductApparelSizeFilter
'SIZE_3XL' | 'SIZE_4XL' | 'SIZE_5XL' | 'SIZE_L' | 'SIZE_M' | 'SIZE_S' | 'SIZE_XL' | 'SIZE_XS' | 'SIZE_XXL' | 'SIZE_XXS'ProductColorFilter
'BEIGE' | 'BLACK' | 'BLUE' | 'BROWN' | 'GOLD' | 'GREEN' | 'GREY' | 'NAVY' | 'ORANGE' | 'PINK' | 'PURPLE' | 'RED' | 'SILVER' | 'WHITE' | 'YELLOW'ProductShoeSizeFilter
'SIZE_4' | 'SIZE_4_5' | 'SIZE_5' | 'SIZE_5_5' | 'SIZE_6' | 'SIZE_6_5' | 'SIZE_7' | 'SIZE_7_5' | 'SIZE_8' | 'SIZE_8_5' | 'SIZE_9' | 'SIZE_9_5' | 'SIZE_10' | 'SIZE_10_5' | 'SIZE_11' | 'SIZE_11_5' | 'SIZE_12' | 'SIZE_12_5' | 'SIZE_13' | 'SIZE_13_5' | 'SIZE_14' | 'SIZE_14_5' | 'SIZE_15'ProductSearchSortBy
'MOST_RECENT' | 'PRICE_HIGH_TO_LOW' | 'PRICE_LOW_TO_HIGH' | 'RELEVANCE'GetProductSearchResponse
- data
T - pageInfo
PaginationInfo
GetProductVariantsParams
- after
string - fetchPolicy
DataHookFetchPolicy - first
number - id
string
GetProductVariantsResponse
- data
T - pageInfo
PaginationInfo
GetProductsParams
- fetchPolicy
DataHookFetchPolicy - ids
string[]
GetProductsResponse
- data
Product[]
GetRecentProductsParams
- after
string - fetchPolicy
DataHookFetchPolicy - first
number - includeSensitive
boolean
GetRecentProductsResponse
- data
T - pageInfo
PaginationInfo
GetRecentShopsParams
- after
string - fetchPolicy
DataHookFetchPolicy - first
number
GetRecentShopsResponse
- data
T - pageInfo
PaginationInfo
GetRecommendedProductsParams
- after
string - fetchPolicy
DataHookFetchPolicy - first
number
GetRecommendedProductsResponse
- data
T - pageInfo
PaginationInfo
GetRecommendedShopsParams
- after
string - fetchPolicy
DataHookFetchPolicy - first
number
GetRecommendedShopsResponse
- data
T - pageInfo
PaginationInfo
GetSavedProductsParams
- after
string - fetchPolicy
DataHookFetchPolicy - first
number - includeSensitive
boolean
GetSavedProductsResponse
- data
T - pageInfo
PaginationInfo
GetShopParams
- fetchPolicy
DataHookFetchPolicy - id
string
GetShopResponse
- data
Shop
Shop
- id
string - isFollowing
boolean | null - logoImage
ProductImage | null - name
string - primaryDomain
{ url: string; } - reviewAnalytics
{ averageRating?: number; reviewCount: number; } - shareUrl
string | null - visualTheme
VisualTheme | null
VisualTheme
- brandSettings
BrandSettings | null - description
string | null - featuredImages
ImageType[] - id
string - logoImage
ImageType | null
BrandSettings
- colors
ColorTheme | null - headerTheme
HeaderTheme | null - id
string - logos
LogoTheme | null
ColorTheme
- coverDominant
string | null - id
string - logoAverage
string | null - logoDominant
string | null - primary
string | null - secondary
string | null - secondaryText
string | null - statusBarStyle
string | null
HeaderTheme
- coverImage
ImageType | null - endingScrimColor
string | null - id
string - startingScrimColor
string | null - thumbnailImage
ImageType | null - videoUrl
string | null - wordmark
ImageType | null
ImageType
- altText
string | null - height
number | null - sensitive
boolean - thumbhash
string | null - url
string - width
number | null
LogoTheme
- id
string - logoImage
ImageType | null
GetShopAppInformationResponse
- appVersion
string - buildId
string - buildNumber
string
GetShopsWithDiscountsParams
- after
string - fetchPolicy
DataHookFetchPolicy - first
number
GetShopsWithDiscountsResponse
- data
T - pageInfo
PaginationInfo
GetSimilarProductsParams
- after
Cursor for pagination. Currently the backend returns only a first page, so this is effectively unused.
string - fetchPolicy
DataHookFetchPolicy - first
Number of products to return. Must be 1..10.
number - similarTo
Source for similar product search. Exactly one of `productId`, `productVariantId`, or `media` must be set.
GetSimilarProductsSourceInput
GetSimilarProductsSourceInput
The source for similar product search. Exactly one of `productId`, `productVariantId`, or `media` must be provided.
- media
JPEG image media to find similar products for.
GetSimilarProductsMediaInput - productId
Shopify Product GID, e.g. `gid://shopify/Product/123`.
string - productVariantId
Shopify ProductVariant GID, e.g. `gid://shopify/ProductVariant/456`.
string
GetSimilarProductsMediaInput
Image media used as the source for similar product search. The hook handles base64 encoding from a File — partners pass a File directly, not the encoded payload.
- base64
The base64-encoded image content (without `data:` prefix). Must be <= 4 MiB.
string - contentType
The image MIME type. Currently only `image/jpeg` is supported.
string
GetSimilarProductsResponse
- data
T - pageInfo
PaginationInfo
InvokeIntentParams
Params for the INVOKE_INTENT shop action.
- action
Verb describing the operation (e.g., 'create', 'edit', 'view')
string - data
Optional JSON-serializable input payload
TData - type
MIME-type identifier for the target resource (e.g., 'shop/UserImage')
string - value
Optional identifier (e.g. a resource GID) for an existing resource
string
InvokeIntentResponse
Untyped intent response used at the INVOKE_INTENT bridge boundary.
IntentResultIntentResult
Discriminated union of all possible intent completion outcomes. - `'ok'` — workflow completed successfully with typed result data - `'error'` — workflow failed with a message - `'closed'` — user dismissed without completing
IntentResultOk<T> | IntentResultError | IntentResultClosedIntentResultOk
Successful intent completion. `data` follows the declared response type: `void` → omitted, concrete shape → required, untyped (`unknown`) → optional.
unknown extends T
? {code: 'ok'; data?: T}
: [T] extends [void]
? {code: 'ok'}
: {code: 'ok'; data: T}IntentResultError
- code
'error' - message
string
IntentResultClosed
- code
'closed'
NavigateToCheckoutParams
- shopId
The GID of the shop. E.g. `gid://shopify/Shop/123`.
string
NavigateToDeeplinkParams
- deeplink
string
NavigateToOrderParams
- orderId
The GID of the order. E.g. `gid://shopify/Order/123`.
string
NavigateToProductParams
- attribution
LineItemAttribution - discountCode
The discount code to apply to the product.
string - includedProductVariantGIDs
string[] - includedProductVariantIds
string[] - productId
The GID of the product. E.g. `gid://shopify/Product/123`.
string - productVariantId
If present, the GID of the variant that should be initially selected
string
NavigateToShopParams
- shopId
string
PreviewProductInARParams
- fetchPolicy
DataHookFetchPolicy - id
string
ProductRecommendationClickParams
- attribution
LineItemAttribution - discountCode
string - productId
string - productVariantId
string - sectionId
string - variantGIDs
string[]
ProductRecommendationImpressionParams
- productId
string - sectionId
string
RemoveAsyncStorageItemParams
- key
string
RemoveProductListParams
- id
The GID of the product list. E.g. `gid://shopapp/ProductList/123`.
string
RemoveProductListItemParams
- listId
The GID of the product list. E.g. `gid://shopapp/ProductList/123`. This will soon be deprecated in favor of just `publicListId`.
string - productId
The GID of the product. E.g. `gid://shopify/Product/123`.
string - productVariantId
The GID of the product variant. E.g. `gid://shopify/ProductVariant/101`.
string - publicListId
The public ID of the product list.
string - shopId
The GID of the shop. E.g. `gid://shopify/Shop/42`.
string
RenameProductListParams
- id
The GID of the product list. E.g. `gid://shopapp/ProductList/123`.
string - name
The new name of the product list.
string
ReportContentImpressionParams
- pageValue
string - publicId
string
ReportErrorParams
Parameters for reporting JavaScript errors that occur in the webview. This captures detailed error information to help with debugging and monitoring.
- additionalContext
Additional context about the error (e.g., user actions, state, etc.)
{[key: string]: any} - message
The error message
string - stack
The stack trace of the error
string
ReportFetchParams
Parameters for reporting fetch calls made in the webview. This captures network request details for observability.
- duration
Duration of the request in milliseconds
number - error
Error message if the request failed
string - method
The HTTP method used (GET, POST, etc.)
string - status
The HTTP status code of the response (0 for network errors)
number - success
Whether the request was successful (response.ok)
boolean - timestamp
Timestamp when the request completed
number - url
The URL that was fetched
string
ReportImpressionParams
- pageValue
string - subjectId
string - subjectType
string
ReportInteractionParams
- interactionType
string - interactionValue
string - pageValue
string
RequestPermissionParams
- permission
MiniPermission
RequestPermissionResponse
- errorMessage
string - granted
boolean
RequestScopesConsentResponse
- granted
boolean
ResolveIntentParams
Params for the RESOLVE_INTENT shop action. `result` is loose at the bridge; the typed correlation between `intentKey` and `result.data` is enforced by the `useResolveIntent` hook, where K is concrete.
- intentKey
Lets the host verify the Mini resolved the intent it was launched with.
IntentKey - result
IntentResult
IntentKey
keyof IntentDefinitionsIntentDefinitions
- addToCartProductVariant
{ action: "add_to_cart"; type: "shopify/ProductVariant"; data: AddToCartProductVariantParams; result: AddToCartProductVariantResult; } - buyNowProductVariant
{ action: "buy_now"; type: "shopify/ProductVariant"; data: BuyNowProductVariantParams; result: BuyNowProductVariantResult; } - createUserImage
{ action: "create"; type: "shop/UserImage"; data: CreateUserImageParams; result: ImageUrlResponse; } - selectProductVariant
{ action: "select"; type: "shopify/ProductVariant"; data: SelectProductVariantParams; result: SelectProductVariantResult; } - tryOnProduct
{ action: "try_on"; type: "shopify/Product"; data: TryOnProductParams; result: ImageUrlResponse; }
AddToCartProductVariantParams
Data payload for the `add_to_cart:shopify/ProductVariant` intent. Adds a variant to the user's cart. If `productVariantId` is omitted (or `forceShow` is `true`), the host opens the same native variant selector sheet as `select:shopify/ProductVariant` first — the user picks a variant and quantity, and the host then performs the add-to-cart on confirm. For products outside Shop's catalog (referral products), the host navigates the user to the product's PDP instead of adding to cart.
- discountCodes
Discount codes to apply to the cart when adding.
string[] - forceShow
When `true`, always render the sheet — even for products with a single variant or when `productVariantId` is supplied. Bypasses the single-variant short-circuit so the mini gets a consistent confirmation step. Defaults to `false`.
boolean - includedProductVariantGIDs
Optional allow-list of variant GIDs. When set, only these variants are presented to the user. Other variants are filtered out before the option tree is built. Ignored when `productVariantId` is supplied.
string[] - initialQuantity
Initial quantity displayed in the stepper. Defaults to `quantity ?? 1`.
number - initialVariantId
If present, the GID of the variant that should be initially highlighted in the sheet. Defaults to the product's default variant. Ignored when `productVariantId` is supplied.
string - maxQuantity
Maximum quantity selectable in the stepper. Defaults to the variant's `quantityAvailable` (or unbounded when stock is not tracked).
number - productId
The GID of the product. E.g. `gid://shopify/Product/123`.
string - productVariantId
The GID of the variant to add. When provided, the host adds it directly without showing the sheet. Omit to let the user pick.
string - quantity
Quantity to add. Defaults to `1`.
number - showQuantity
Whether to show the quantity stepper. Defaults to `true`.
boolean
AddToCartProductVariantResult
Successful payload returned from `add_to_cart:shopify/ProductVariant`. Discriminate via `data.outcome`: - `'added_to_cart'` — a concrete variant was added; selection fields (`productVariantId`, `quantity`, `source`) are present. - `'navigated_to_product'` — the user tapped the sheet's product header and the host took them to the PDP. The cart was not modified. - `'redirected_to_product'` — the host could not add this product (e.g. referral product on another merchant's storefront) and redirected the user to the PDP. Only `productId` is present.
AddToCartAddedResult | AddToCartNavigatedToProductResult | AddToCartRedirectedToProductResultAddToCartAddedResult
Variant added to the cart by `add_to_cart:shopify/ProductVariant`.
- outcome
Discriminator. The host added a concrete variant to the cart.
'added_to_cart' - productVariantId
The GID of the variant the user picked.
string - quantity
The quantity the user chose in the stepper. `1` when the stepper is hidden.
number - source
Indicates whether the user actively picked a variant in the sheet (`'user'`) or whether the host resolved the selection automatically without showing UI (`'auto'`). `'auto'` is returned when the product has a single selectable variant and `forceShow` is `false` (the default). `'user'` is returned in every other success case — i.e. the sheet was rendered and the user tapped the CTA.
'auto' | 'user' - variant
The full variant the user picked.
ProductVariant
AddToCartNavigatedToProductResult
Returned when the user tapped the sheet's product header to view the PDP instead of adding to cart. The sheet is dismissed and the user is now on the PDP.
- outcome
Discriminator. The user navigated to the PDP from the sheet.
'navigated_to_product' - productId
GID of the product the host navigated to.
string - productVariantId
GID of the variant that was highlighted when the user tapped to navigate. The PDP opens scoped to this variant.
string
AddToCartRedirectedToProductResult
Returned when the product cannot be added to the cart from the mini (e.g. referral products outside Shop's catalog) and the host instead redirected the user to the product's PDP. The mini should treat this as a successful hand-off — the cart was not modified but the shopper is now on the PDP.
- outcome
Discriminator. The host redirected the user to the PDP instead.
'redirected_to_product' - productId
GID of the product the host redirected to.
string
BuyNowProductVariantParams
Data payload for the `buy_now:shopify/ProductVariant` intent. Sends the user to express checkout for a variant, bypassing the cart. If `productVariantId` is omitted (or `forceShow` is `true`), the host opens the same native variant selector sheet as the other variant intents — the user picks a variant and quantity, and the host then creates the checkout on confirm. For products outside Shop's catalog (referral products), the host navigates the user to the product's PDP instead.
- discountCode
Discount code to apply to the checkout.
string - forceShow
When `true`, always render the sheet — even for single-variant products or when `productVariantId` is supplied. Defaults to `false`.
boolean - includedProductVariantGIDs
Allow-list of variant GIDs surfaced in the sheet.
string[] - initialQuantity
Initial quantity in the stepper. Defaults to `quantity ?? 1`.
number - initialVariantId
Variant initially highlighted in the picker.
string - maxQuantity
Max quantity selectable in the stepper.
number - productId
The GID of the product. E.g. `gid://shopify/Product/123`.
string - productVariantId
The GID of the variant to buy. When provided, the host creates the checkout directly without showing the sheet. Omit to let the user pick.
string - quantity
Quantity to buy. Defaults to `1`.
number - showQuantity
Whether to show the quantity stepper. Defaults to `true`.
boolean
BuyNowProductVariantResult
Successful payload returned from `buy_now:shopify/ProductVariant`. Discriminate via `data.outcome`: - `'checkout_opened'` — express checkout opened for a concrete variant; selection fields (`productVariantId`, `quantity`, `source`) are present. - `'navigated_to_product'` — the user tapped the sheet's product header and the host took them to the PDP. No checkout was created. - `'redirected_to_product'` — the host could not buy this product (e.g. referral product on another merchant's storefront) and redirected the user to the PDP. Only `productId` is present.
BuyNowCheckoutOpenedResult | BuyNowNavigatedToProductResult | BuyNowRedirectedToProductResultBuyNowCheckoutOpenedResult
Checkout opened for a concrete variant by `buy_now:shopify/ProductVariant`.
- outcome
Discriminator. The host opened express checkout for a variant.
'checkout_opened' - productVariantId
The GID of the variant the user picked.
string - quantity
The quantity the user chose in the stepper. `1` when the stepper is hidden.
number - source
Indicates whether the user actively picked a variant in the sheet (`'user'`) or whether the host resolved the selection automatically without showing UI (`'auto'`). `'auto'` is returned when the product has a single selectable variant and `forceShow` is `false` (the default). `'user'` is returned in every other success case — i.e. the sheet was rendered and the user tapped the CTA.
'auto' | 'user' - variant
The full variant the user picked.
ProductVariant
BuyNowNavigatedToProductResult
Returned when the user tapped the sheet's product header to view the PDP instead of going to checkout. The sheet is dismissed and the user is now on the PDP.
- outcome
Discriminator. The user navigated to the PDP from the sheet.
'navigated_to_product' - productId
GID of the product the host navigated to.
string - productVariantId
GID of the variant that was highlighted when the user tapped to navigate. The PDP opens scoped to this variant.
string
BuyNowRedirectedToProductResult
Returned when the product cannot be bought from the mini (e.g. referral products outside Shop's catalog) and the host instead redirected the user to the product's PDP. The mini should treat this as a successful hand-off — no checkout was created but the shopper is now on the PDP.
- outcome
Discriminator. The host redirected the user to the PDP instead.
'redirected_to_product' - productId
GID of the product the host redirected to.
string
CreateUserImageParams
- camera
Which camera to default to when the camera is used. Defaults to 'front'.
'front' | 'rear' - crop
Cropping configuration. Omit to skip the cropping step — the user's original photo is returned as-is (capped by `maxSize`).
{ aspectRatio?: { width: number; height: number; }; shape?: "rectangle" | "circle"; } - maxSize
Max width/height of the output image in pixels. Defaults to 700.
number - source
If set, skip the source chooser and open this source directly. When omitted, the host shows a sheet letting the user pick a source.
'camera' | 'library' - tag
Tag identifying the image in the mini's image library. Required so a future saved-images intent can surface previously created images by tag.
string
ImageUrlResponse
- imageUrl
URL of the generated image.
string
SelectProductVariantParams
Data payload for the `select:shopify/ProductVariant` intent. Prompts the user to pick a variant (and quantity) for the product whose GID is passed as `data.productId`. The host renders a native bottom sheet over the mini WebView using the same option pickers as the Shop PDP. Single-variant products short-circuit without showing UI.
- allowOutOfStockSelection
When `true`, the sheet's confirm CTA stays enabled even for a sold-out variant — the host hands the selection back to the mini without touching the cart. Defaults to `true` for the `select` intent so flows like “notify me when back in stock” can pick a sold-out variant. Pass `false` to restore the cart-style sold-out guard.
boolean - forceShow
When `true`, always render the sheet — even for products with a single variant. The single-variant short-circuit (resolving instantly without showing UI) is bypassed. Useful for flows that want a consistent confirmation step regardless of variant count. Defaults to `false`.
boolean - includedProductVariantGIDs
Optional allow-list of variant GIDs. When set, only these variants are presented to the user. Other variants are filtered out before the option tree is built.
string[] - initialQuantity
Initial quantity displayed in the stepper. Defaults to `1`.
number - initialVariantId
If present, the GID of the variant that should be initially highlighted. Defaults to the product's default variant.
string - maxQuantity
Maximum quantity selectable in the stepper. Defaults to the variant's available inventory (or unbounded when stock is not tracked).
number - productId
The GID of the product whose variants should be selectable. E.g. `gid://shopify/Product/123`.
string - showQuantity
Whether to show the quantity stepper. Defaults to `false` for the `select` intent (selection is informational; quantity is rarely relevant). Pass `true` to opt into the stepper.
boolean
SelectProductVariantResult
Successful payload returned from `select:shopify/ProductVariant`. The intent result is `{code: 'ok', data: SelectProductVariantResult}` on success; `{code: 'closed'}` when the user dismisses the sheet. Discriminate via `data.outcome`: - `'selected'` — the user picked a variant from the sheet; the full selection (`productVariantId`, `quantity`, `variant`, `source`) is present. - `'navigated_to_product'` — the user tapped the sheet's product header and the host took them to the PDP. Only `productId` and `productVariantId` (the highlighted variant) are present.
SelectVariantSelectedResult | SelectVariantNavigatedToProductResultSelectVariantSelectedResult
Variant chosen by the user from the sheet's option pickers.
- outcome
Discriminator. The user picked a variant and confirmed.
'selected' - productVariantId
The GID of the variant the user picked.
string - quantity
The quantity the user chose in the stepper. `1` when the stepper is hidden.
number - source
Indicates whether the user actively picked a variant in the sheet (`'user'`) or whether the host resolved the selection automatically without showing UI (`'auto'`). `'auto'` is returned when the product has a single selectable variant and `forceShow` is `false` (the default). `'user'` is returned in every other success case — i.e. the sheet was rendered and the user tapped the CTA.
'auto' | 'user' - variant
The full variant the user picked.
ProductVariant
SelectVariantNavigatedToProductResult
Returned when the user taps the product header inside the sheet to go to the PDP instead of confirming a selection. The sheet is dismissed, the user has navigated to the PDP, and no selection is reported back.
- outcome
Discriminator. The user navigated to the PDP from the sheet.
'navigated_to_product' - productId
GID of the product the host navigated to.
string - productVariantId
GID of the variant that was highlighted when the user tapped to navigate. The PDP opens scoped to this variant.
string
TryOnProductParams
- variantId
Variant the user selected on the PDP that launched the Mini.
string
SearchProductsByShopParams
- after
string - fetchPolicy
DataHookFetchPolicy - first
number - query
string - shopId
string
SearchProductsByShopResponse
- data
T - pageInfo
PaginationInfo
SetAsyncStorageItemParams
- key
string - value
string
SetProductListVisibilityParams
- id
The GID of the product list. E.g. `gid://shopapp/ProductList/123`.
string - name
The name of the product list. Required to preserve the existing name.
string - privacyStatus
The privacy status to set for the product list.
ProductListPrivacyStatus
SetSecretParams
- value
string
ShareParams
- failOnCancel
boolean - message
string - title
string - type
string - url
string - urls
string[]
ShareResponse
- dismissedAction
boolean - message
string - success
boolean
ShareSingleParams
BaseShareSingleOptions | InstagramShareSingleOptions | FacebookShareSingleOptionsBaseShareSingleOptions
- appId
string - email
string - filename
string - forceDialog
boolean - message
string - recipient
string - social
Social.Facebook | Social.Pagesmanager | Social.Twitter | Social.Whatsapp | Social.Whatsappbusiness | Social.Instagram | Social.Googleplus | Social.Email | Social.Pinterest | Social.Linkedin | Social.Sms | Social.Telegram | Social.Snapchat | Social.Messenger | Social.Viber | Social.Discord - subject
string - title
string - type
string - url
string - urls
string[]
Social
- Facebook
facebook - FacebookStories
facebookstories - Pagesmanager
pagesmanager - Twitter
twitter - Whatsapp
whatsapp - Whatsappbusiness
whatsappbusiness - Instagram
instagram - InstagramStories
instagramstories - Googleplus
googleplus - Email
email - Pinterest
pinterest - Linkedin
linkedin - Sms
sms - Telegram
telegram - Snapchat
snapchat - Messenger
messenger - Viber
viber - Discord
discord
InstagramShareSingleOptions
- appId
string - attributionURL
string - backgroundBottomColor
string - backgroundImage
string - backgroundTopColor
string - backgroundVideo
string - email
string - filename
string - forceDialog
boolean - linkText
string - linkUrl
string - message
string - recipient
string - social
Social.InstagramStories - stickerImage
string - subject
string - title
string - type
string - url
string - urls
string[]
FacebookShareSingleOptions
- appId
string - attributionURL
string - backgroundBottomColor
string - backgroundImage
string - backgroundTopColor
string - backgroundVideo
string - email
string - filename
string - forceDialog
boolean - linkText
string - linkUrl
string - message
string - recipient
string - social
Social.FacebookStories - stickerImage
string - subject
string - title
string - type
string - url
string - urls
string[]
ShareSingleResponse
- message
string - success
boolean
ShowErrorScreenParams
- message
The message to display in the error screen.
string - title
The title of the error screen.
string
ShowErrorToastParams
- message
string
ShowFeedbackSheetParams
- publicId
string
TranslateContentUpParams
- inputYPosition
number
UnfavoriteParams
- productId
string - productVariantId
string - shopId
string
UnfollowShopParams
- shopId
string
SnakeToCamelCase
S extends `${infer Head}_${infer Tail}`
? `${Lowercase<Head>}${SnakeToCamelCaseTail<Tail>}`
: Lowercase<S>SnakeToCamelCaseTail
S extends `${infer Head}_${infer Tail}`
? `${CapitalizeSegment<Head>}${SnakeToCamelCaseTail<Tail>}`
: CapitalizeSegment<S>CapitalizeSegment
Uppercase<S> extends 'AR' ? 'AR' : Capitalize<Lowercase<S>>tsx
Examples
Example code
tsx
import {useCallback} from 'react' import {useErrorToast, Button} from '@shopify/shop-minis-react' export default function MyComponent() { const {showErrorToast} = useErrorToast() const handleError = useCallback(() => { showErrorToast({ message: 'Something went wrong', }) }, [showErrorToast]) return <Button onClick={handleError}>Show error toast</Button> }