---
url: https://polaris-vue-elements.dev/app-bridge/types/user-interface-and-interactions.md
description: >-
  Types of the App Bridge user interface and interactions APIs in
  @shopify/app-bridge-types, for Vue 3: their members and the types only they
  use.
---

# User interface and interactions {#user-interface-and-interactions}

> **Beta:** These App Bridge components are new, and their API may change in a minor release while in beta. Their behaviour is checked in a live Shopify admin by a local E2E suite. If something doesn't work, please [open an issue](https://github.com/HQCuong/polaris-vue/issues).

The APIs Shopify lists under user interface and interactions, and the types only they use. On this page: [`IntentsApi`](#intentsapi), [`LoadingApi`](#loadingapi), [`ModalApi`](#modalapi), [`PickerApi`](#pickerapi), [`ResourcePickerApi`](#resourcepickerapi), [`ReviewsApi`](#reviewsapi), [`SaveBarApi`](#savebarapi), [`SidekickApi`](#sidekickapi), [`SupportApi`](#supportapi), [`ToastApi`](#toastapi), [`Tools`](#tools).

## `IntentsApi` {#intentsapi}

Extends: `PublicIntentsApi`

`register(callback: (intent: Intent) => void): () => void`

Used in: [useAppBridge()](/app-bridge/use-app-bridge), [`ShopifyGlobal`](/app-bridge/types/#shopifyglobal)

### `Intent` {#intent}

`readonly action: string`

`readonly type: string`

`readonly data: { [key: string]: any; }`

`finish: Finish`

Used in: [`IntentsApi`](#intentsapi)

### `PublicIntentsApi` {#publicintentsapi}

`request: IntentRequestApi`

The current intent request as a subscribable.

When the app isn't running inside an intent workflow, the current value is `null`.

`invoke?(query: IntentQuery): Promise<IntentActivity>`

Invoke an intent using the object syntax.

`invoke?(intentURL: string, options?: IntentQueryOptions): Promise<IntentActivity>`

Invoke an intent using the URL syntax.

URL format: `action:type[,value][?params]`.

`response?: IntentResponseApi`

If in an intent workflow, provides mechanisms to resolve the intent with a given response.

Used in: [`IntentsApi`](#intentsapi)

### `Finish` {#finish}

```ts
type Finish = (data?: any) => void;
```

Used in: [`Intent`](#intent)

### `IntentActivity` {#intentactivity}

`complete?: Promise<IntentResponse>`

A Promise that resolves when the intent workflow completes, returning the response.

Used in: [`PublicIntentsApi`](#publicintentsapi)

### `IntentQuery` {#intentquery}

Extends: `IntentQueryOptions`

`action: IntentAction`

`type: IntentType`

Used in: [`PublicIntentsApi`](#publicintentsapi)

### `IntentQueryOptions` {#intentqueryoptions}

`value?: string`

The resource identifier for edit actions (e.g., 'gid://shopify/Product/123').

`data?: { [key: string]: unknown; }`

Additional data required for certain intent types. For example:

* Discount creation requires { type: 'amount-off-product' | 'amount-off-order' | 'buy-x-get-y' | 'free-shipping' }
* ProductVariant creation requires { productId: 'gid://shopify/Product/123' }
* Metaobject creation requires { type: 'shopify--color-pattern' }

Used in: [`IntentQuery`](#intentquery), [`PublicIntentsApi`](#publicintentsapi)

### `IntentRequestApi` {#intentrequestapi}

`readonly value: IntentRequest | null`

`subscribe(callback: (value: IntentRequest | null) => void): () => void`

Used in: [`PublicIntentsApi`](#publicintentsapi)

### `IntentResponseApi` {#intentresponseapi}

`ok: (data?: SuccessIntentResponse["data"]) => Promise<void>`

If in an intent workflow, resolves the intent with a success response and the provided data, if any.

`error: (message: string, issues?: StandardSchemaV1.Issue[]) => Promise<void>`

If in an intent workflow, resolves the intent with an error response and the provided message and issues, if any.

`closed: () => Promise<void>`

If in an intent workflow, resolves the intent with a closed response.

Used in: [`PublicIntentsApi`](#publicintentsapi)

### `IntentResponse` {#intentresponse}

```ts
type IntentResponse = ClosedIntentResponse | SuccessIntentResponse | ErrorIntentResponse;
```

References: [`ClosedIntentResponse`](#closedintentresponse), [`ErrorIntentResponse`](#errorintentresponse), [`SuccessIntentResponse`](#successintentresponse)
Used in: [`IntentActivity`](#intentactivity)

### `IntentAction` {#intentaction}

```ts
type IntentAction = "create" | "edit" | "pick";
```

Used in: [`IntentQuery`](#intentquery)

### `IntentType` {#intenttype}

```ts
type IntentType = "settings/LocationDefault" | "settings/OrderIDFormat" | "settings/OrderProcessing" | "settings/StoreDefaults" | "settings/StoreDetails" | "shopify/Article" | "shopify/Catalog" | "shopify/Collection" | "shopify/Customer" | "shopify/Discount" | "shopify/File" | "shopify/Location" | "shopify/Market" | "shopify/Menu" | "shopify/MetafieldDefinition" | "shopify/Metaobject" | "shopify/MetaobjectDefinition" | "shopify/Page" | "shopify/Product" | "shopify/ProductVariant";
```

Used in: [`IntentQuery`](#intentquery)

### `IntentRequest` {#intentrequest}

`action: string`

`type: string`

`value?: unknown`

`data?: { [key: string]: unknown; }`

Used in: [`IntentRequestApi`](#intentrequestapi)

### `SuccessIntentResponse` {#successintentresponse}

`code?: "ok"`

`data?: { [key: string]: unknown; }`

Used in: [`IntentResponse`](#intentresponse), [`IntentResponseApi`](#intentresponseapi)

### `ClosedIntentResponse` {#closedintentresponse}

`code?: "closed"`

Used in: [`IntentResponse`](#intentresponse)

### `ErrorIntentResponse` {#errorintentresponse}

`code?: "error"`

`message?: string`

`issues?: StandardSchemaV1.Issue[]`

Used in: [`IntentResponse`](#intentresponse)

## `LoadingApi` {#loadingapi}

```ts
type LoadingApi = (isLoading?: boolean) => void;
```

Used in: [useAppBridge()](/app-bridge/use-app-bridge), [`ShopifyGlobal`](/app-bridge/types/#shopifyglobal)

## `ModalApi` {#modalapi}

Extends: `Required<_ModalApi>`

Used in: [useAppBridge()](/app-bridge/use-app-bridge), [Modal](/app-bridge/modal), [`ShopifyGlobal`](/app-bridge/types/#shopifyglobal)

### `_ModalApi` {#\_modalapi}

`show?(id: string): Promise<void>`

Shows the modal element. An alternative to the `showOverlay` instance method on the `s-modal` component.

`hide?(id: string): Promise<void>`

Hides the modal element. An alternative to the `hideOverlay` instance method on the `s-modal` component.

`toggle?(id: string): Promise<void>`

Toggles the modal element visibility. An alternative to the `toggleOverlay` instance method on the `s-modal` component.

Used in: [`ModalApi`](#modalapi)

## `PickerApi` {#pickerapi}

```ts
type PickerApi = (options: PickerOptions) => Promise<{
    selected: Promise<string[] | undefined>;
}>;
```

References: [`PickerOptions`](#pickeroptions)
Used in: [useAppBridge()](/app-bridge/use-app-bridge), [`ShopifyGlobal`](/app-bridge/types/#shopifyglobal)

### `PickerOptions` {#pickeroptions}

`heading: string`

The heading displayed at the top of the picker modal. Use a clear, descriptive title that tells merchants what they're selecting.

`multiple?: boolean | number`

The selection mode for the picker. Pass `true` to allow unlimited selections, `false` for single-item selection only, or a number to set a maximum selection limit (for example, `3` allows up to three items).

Default: `false`

`headers?: Header[]`

The column headers for the picker table. Define headers to label and organize the data columns displayed for each item. The header order determines the column layout.

`items: PickerItem[]`

The list of items that merchants can select from. Each item appears as a row in the picker table.

Used in: [`PickerApi`](#pickerapi)

### `Header` {#header}

`content?: string`

The label text displayed at the top of the table column. Use clear, concise labels that describe the data in that column (for example, "Price", "Status", "Last Updated").

`type?: "string" | "number"`

The data type that controls column formatting and text alignment. Use `'number'` for currency, prices, or numeric values (displays right-aligned), or `'string'` for text content (displays left-aligned).

Default: `'string'`

Used in: [`PickerOptions`](#pickeroptions)

### `PickerItem` {#pickeritem}

`id: string`

The unique identifier for this item. This ID is returned in the selection array when the merchant selects this item. Use an ID that helps you identify the item in your system (for example, template IDs, review IDs, or custom option keys).

`heading: string`

The primary text displayed in the first column. This is typically the item's name or title and is the most prominent text in the row.

`data?: DataPoint[]`

Additional data displayed in subsequent columns after the heading. Each value appears in its own column, and the order must match the `headers` array. For example, if headers are `["Price", "Status"]`, then data would be `[19.99, "Active"]`.

`disabled?: boolean`

Whether the item can be selected. When `true`, the item is disabled and can't be selected. Disabled items appear grayed out. Use this for items that are unavailable or don't meet selection criteria.

Default: `false`

`selected?: boolean`

Whether the item is preselected when the picker opens. When `true`, the item appears selected by default. Merchants can still deselect preselected items. Use this to show current selections or suggest default choices.

`badges?: Badge[]`

Status or context badges displayed next to the heading in the first column. Use badges to highlight item state, completion status, or other important attributes (for example, "Draft", "Published", "Incomplete").

`thumbnail?: { url: string; }`

A small preview image or icon displayed at the start of the row. Thumbnails help merchants visually identify items at a glance. Provide a URL to the image file.

Used in: [`PickerOptions`](#pickeroptions)

### `Badge` {#badge}

`content: string`

The text content of the badge. Keep this short and descriptive (for example, "Draft", "Active", "Incomplete").

`tone?: Tone`

The visual tone indicating status or importance. Choose a tone that matches the badge's meaning.

`progress?: Progress`

The progress indicator for the badge. Use this to show completion status for items that have progress states.

Used in: [`PickerItem`](#pickeritem)

### `DataPoint` {#datapoint}

```ts
type DataPoint = string | number | undefined;
```

Used in: [`PickerItem`](#pickeritem)

### `Progress` {#progress}

```ts
type Progress = "incomplete" | "partiallyComplete" | "complete";
```

Used in: [`Badge`](#badge)

### `Tone` {#tone}

```ts
type Tone = "info" | "success" | "warning" | "critical";
```

Used in: [`Badge`](#badge)

## `ResourcePickerApi` {#resourcepickerapi}

```ts
type ResourcePickerApi = <ResourceType extends keyof ResourceTypes = keyof ResourceTypes>(options: ResourcePickerOptions<ResourceType>) => Promise<SelectPayload<ResourceType> | undefined>;
```

References: [`ResourcePickerOptions`](#resourcepickeroptions), [`ResourceTypes`](#resourcetypes), [`SelectPayload`](#selectpayload)
Used in: [useAppBridge()](/app-bridge/use-app-bridge), [`ShopifyGlobal`](/app-bridge/types/#shopifyglobal)

### `ResourcePickerOptions` {#resourcepickeroptions}

Type parameters: `ResourceType extends keyof ResourceTypes = keyof ResourceTypes`

`type: ResourceType`

The type of Shopify resource to select: `'product'` for products, `'variant'` for specific product variants, or `'collection'` for collections. This determines what appears in the picker and what data structure is returned.

`action?: "add" | "select"`

The action verb that appears in the title as the primary action of the resource picker. "Add" prompts merchants that they are appending to an existing list, while "select" they'll choose a resource for a specific purpose or replacing selections.

Default: `'add'`

`filter?: Filters`

Filtering options that control which resources appear in the resourcepicker. Use filters to restrict resources by publication status, include or exclude variants, or apply custom search criteria. This helps merchants find relevant items faster.

`multiple?: boolean | number`

Whether to allow selecting multiple items of a specific type. If a number is provided, limit selections to that maximum. When `type` is `'product'`, merchants can still select multiple variants from a single product even when `multiple` is `false`.

Default: `false`

`query?: string`

Initial GraphQL search query for filtering resources available in the resource picker. See [search syntax](https://shopify.dev/docs/api/usage/search-syntax) for more information. This is displayed in the search bar when the picker is opened and can be edited by users. For most use cases, you should use the `filter.query` option instead which doesn't show the query in the UI.

Default: `''`

`selectionIds?: BaseResource[]`

Resources that should be preselected when the picker is opened. Use this for edit workflows to show what products are already in a bundle, collection, or promotional set. Merchants can see current selections and modify them before confirming.

Default: `[]`

Used in: [useAppBridge()](/app-bridge/use-app-bridge), [`ResourcePickerApi`](#resourcepickerapi)

### `ResourceTypes` {#resourcetypes}

`product: Product`

`variant: ProductVariant`

`collection: Collection`

Used in: [`ResourcePickerApi`](#resourcepickerapi), [`ResourcePickerOptions`](#resourcepickeroptions), [`ResourceSelection`](#resourceselection), [`SelectPayload`](#selectpayload)

### `SelectPayload` {#selectpayload}

```ts
type SelectPayload<Type extends keyof ResourceTypes> = WithSelection<ResourceSelection<Type>[]>;
```

References: [`ResourceSelection`](#resourceselection), [`ResourceTypes`](#resourcetypes), [`WithSelection`](#withselection)
Used in: [`ResourcePickerApi`](#resourcepickerapi)

### `BaseResource` {#baseresource}

Extends: `Resource`

`variants?: Resource[]`

Used in: [`ResourcePickerOptions`](#resourcepickeroptions)

### `Filters` {#filters}

`hidden?: boolean`

Whether to show hidden resources, referring to products that are not published on any sales channels.

Default: `true`

`variants?: boolean`

Whether to show product variants. Only applies to the Product resource type picker.

Default: `true`

`draft?: boolean | undefined`

Whether to show [draft products](https://help.shopify.com/en/manual/products/details?shpxid=70af7d87-E0F2-4973-8B09-B972AAF0ADFD#product-availability). Only applies to the Product resource type picker. Setting this to undefined will show a badge on draft products.

Default: `true`

`archived?: boolean | undefined`

Whether to show [archived products](https://help.shopify.com/en/manual/products/details?shpxid=70af7d87-E0F2-4973-8B09-B972AAF0ADFD#product-availability). Only applies to the Product resource type picker. Setting this to undefined will show a badge on draft products.

Default: `true`

`query?: string`

GraphQL initial search query for filtering resources available in the picker. See [search syntax](https://shopify.dev/docs/api/usage/search-syntax) for more information. This query is not visible to merchants and runs server-side. Use it to programmatically restrict results (for example, `vendor:Acme`) without exposing the filter logic.

Used in: [`ResourcePickerOptions`](#resourcepickeroptions)

### `Collection` {#collection}

Import: `import type { Collection } from 'polaris-vue-elements/app-bridge'`

Extends: `Resource`

`availablePublicationCount: number`

`description: string`

`descriptionHtml: string`

`handle: string`

`id: string`

`image?: Image | null`

`productsAutomaticallySortedCount: number`

`productsCount: number`

`productsManuallySortedCount: number`

`publicationCount: number`

`ruleSet?: RuleSet | null`

`seo: { description?: string | null; title?: string | null; }`

`sortOrder: CollectionSortOrder`

`storefrontId: string`

`templateSuffix?: string | null`

`title: string`

`updatedAt: string`

Used in: [`ResourceTypes`](#resourcetypes)

### `Product` {#product}

Import: `import type { Product } from 'polaris-vue-elements/app-bridge'`

Extends: `Resource`

`availablePublicationCount: number`

`createdAt: string`

`descriptionHtml: string`

`handle: string`

`hasOnlyDefaultVariant: boolean`

`images: Image[]`

`options: { id: string; name: string; position: number; values: string[]; }[]`

`productType: string`

`publishedAt?: string | null`

`tags: string[]`

`templateSuffix?: string | null`

`title: string`

`totalInventory: number`

`totalVariants: number`

`tracksInventory: boolean`

`variants: Partial<ProductVariant>[]`

`vendor: string`

`updatedAt: string`

`status: ProductStatus`

Used in: [`ProductVariant`](#productvariant), [`ResourceTypes`](#resourcetypes)

### `ProductVariant` {#productvariant}

Import: `import type { ProductVariant } from 'polaris-vue-elements/app-bridge'`

Extends: `Resource`

`availableForSale: boolean`

`barcode?: string | null`

`compareAtPrice?: Money | null`

`createdAt: string`

`displayName: string`

`fulfillmentService?: { id: string; inventoryManagement: boolean; productBased: boolean; serviceName: string; type: FulfillmentServiceType; }`

`image?: Image | null`

`inventoryItem: { id: string; }`

`inventoryManagement: ProductVariantInventoryManagement`

`inventoryPolicy: ProductVariantInventoryPolicy`

`inventoryQuantity?: number | null`

`position: number`

`price: Money`

`product: Partial<Product>`

`requiresShipping: boolean`

`selectedOptions: { value?: string | null; }[]`

`sku?: string | null`

`taxable: boolean`

`title: string`

`weight?: number | null`

`weightUnit: WeightUnit`

`updatedAt: string`

Used in: [`Product`](#product), [`ResourceTypes`](#resourcetypes)

### `ResourceSelection` {#resourceselection}

```ts
type ResourceSelection<Type extends keyof ResourceTypes> = ResourceTypes[Type];
```

References: [`ResourceTypes`](#resourcetypes)
Used in: [`SelectPayload`](#selectpayload)

### `WithSelection` {#withselection}

```ts
type WithSelection<T> = T & {
    selection: T;
};
```

Used in: [`SelectPayload`](#selectpayload)

### `Resource` {#resource}

`id: string`

in GraphQL id format, ie 'gid://shopify/Product/1'

Used in: [`BaseResource`](#baseresource), [`Collection`](#collection), [`Product`](#product), [`ProductVariant`](#productvariant)

### `CollectionSortOrder` {#collectionsortorder}

```ts
declare enum CollectionSortOrder {
    Manual = "MANUAL",
    BestSelling = "BEST_SELLING",
    AlphaAsc = "ALPHA_ASC",
    AlphaDesc = "ALPHA_DESC",
    PriceDesc = "PRICE_DESC",
    PriceAsc = "PRICE_ASC",
    CreatedDesc = "CREATED_DESC",
    Created = "CREATED",
    MostRelevant = "MOST_RELEVANT"
}
```

Used in: [`Collection`](#collection)

### `Image` {#image}

`id: string`

`altText?: string`

`originalSrc: string`

Used in: [`Collection`](#collection), [`Product`](#product), [`ProductVariant`](#productvariant)

### `RuleSet` {#ruleset}

`appliedDisjunctively: boolean`

`rules: CollectionRule[]`

Used in: [`Collection`](#collection)

### `ProductStatus` {#productstatus}

```ts
declare enum ProductStatus {
    Active = "ACTIVE",
    Archived = "ARCHIVED",
    Draft = "DRAFT"
}
```

Used in: [`Product`](#product)

### `FulfillmentServiceType` {#fulfillmentservicetype}

```ts
declare enum FulfillmentServiceType {
    GiftCard = "GIFT_CARD",
    Manual = "MANUAL",
    ThirdParty = "THIRD_PARTY"
}
```

Used in: [`ProductVariant`](#productvariant)

### `Money` {#money}

```ts
type Money = string;
```

Used in: [`ProductVariant`](#productvariant)

### `ProductVariantInventoryManagement` {#productvariantinventorymanagement}

```ts
declare enum ProductVariantInventoryManagement {
    Shopify = "SHOPIFY",
    NotManaged = "NOT_MANAGED",
    FulfillmentService = "FULFILLMENT_SERVICE"
}
```

Used in: [`ProductVariant`](#productvariant)

### `ProductVariantInventoryPolicy` {#productvariantinventorypolicy}

```ts
declare enum ProductVariantInventoryPolicy {
    Deny = "DENY",
    Continue = "CONTINUE"
}
```

Used in: [`ProductVariant`](#productvariant)

### `WeightUnit` {#weightunit}

```ts
declare enum WeightUnit {
    Kilograms = "KILOGRAMS",
    Grams = "GRAMS",
    Pounds = "POUNDS",
    Ounces = "OUNCES"
}
```

Used in: [`ProductVariant`](#productvariant)

### `CollectionRule` {#collectionrule}

`column: string`

`condition: string`

`relation: string`

Used in: [`RuleSet`](#ruleset)

## `ReviewsApi` {#reviewsapi}

`request(): Promise<ReviewRequestResponse>`

Requests an app review modal. The modal only displays if rate limits and eligibility conditions are met. Returns a Promise that resolves to a response object with `success`, `code`, and `message` properties indicating whether the modal was shown and, if not, the reason why.

Used in: [useAppBridge()](/app-bridge/use-app-bridge), [`ShopifyGlobal`](/app-bridge/types/#shopifyglobal)

### `ReviewRequestResponse` {#reviewrequestresponse}

```ts
type ReviewRequestResponse = ReviewRequestSuccessResponse | ReviewRequestDeclinedResponse;
```

References: [`ReviewRequestDeclinedResponse`](#reviewrequestdeclinedresponse), [`ReviewRequestSuccessResponse`](#reviewrequestsuccessresponse)
Used in: [`ReviewsApi`](#reviewsapi)

### `ReviewRequestDeclinedResponse` {#reviewrequestdeclinedresponse}

`success: false`

Indicates the review modal was not displayed.

`code: ReviewRequestDeclinedCode`

A code identifying why the modal was not displayed, such as rate limits or merchant eligibility.

`message: string`

A human-readable message explaining why the modal was not displayed.

Used in: [`ReviewRequestResponse`](#reviewrequestresponse)

### `ReviewRequestSuccessResponse` {#reviewrequestsuccessresponse}

`success: true`

Indicates the review modal was successfully displayed.

`code: "success"`

The response code. Always `'success'` for a successful request.

`message: "Review modal shown successfully"`

A human-readable message confirming the modal was shown.

Used in: [`ReviewRequestResponse`](#reviewrequestresponse)

### `ReviewRequestDeclinedCode` {#reviewrequestdeclinedcode}

```ts
type ReviewRequestDeclinedCode = "mobile-app" | "already-reviewed" | "annual-limit-reached" | "cooldown-period" | "merchant-ineligible" | "recently-installed" | "already-open" | "open-in-progress" | "cancelled";
```

Used in: [`ReviewRequestDeclinedResponse`](#reviewrequestdeclinedresponse)

## `SaveBarApi` {#savebarapi}

Extends: `Required<_SaveBarApi>`

Used in: [useAppBridge()](/app-bridge/use-app-bridge), [`ShopifyGlobal`](/app-bridge/types/#shopifyglobal)

### `_SaveBarApi` {#\_savebarapi}

`show?(id: string): Promise<void>`

Displays the save bar to indicate unsaved changes. Call this when you want to prompt the merchant to save.

`hide?(id: string): Promise<void>`

Hides the save bar. Call this after the merchant saves or discards their changes.

`toggle?(id: string): Promise<void>`

Toggles save bar visibility between shown and hidden states.

`leaveConfirmation?(): Promise<void>`

Prompts the merchant to deal with unsaved changes before your app navigates. The promise resolves when no save bar is visible, or when the merchant chooses to leave. In the Shopify admin on the web, a visible save bar asks the merchant to save or discard their changes instead, and the promise stays pending, so the code after it doesn't run.

Call it before each navigation that App Bridge can't intercept: changes to `window.location`, and client-side router calls such as `router.push()` in the Next.js App Router, which renders the next page before it updates the URL. For example, call `await shopify.saveBar.leaveConfirmation()` before `router.push()`. If your app navigates without it, the page changes and the merchant's unsaved changes are lost. Link clicks, `window.open()`, and the browser's back and forward buttons are already guarded.

Used in: [`SaveBarApi`](#savebarapi)

## `SidekickApi` {#sidekickapi}

`isEnabled(): Promise<boolean>`

Checks whether Sidekick is available to the app on this store. Call it before showing a launch entry point.

`isOpen(): Promise<boolean>`

Checks whether the Sidekick panel is open.

`open(): Promise<void>`

Opens the Sidekick panel without sending a prompt.

`launch(request: SidekickLaunchRequest | string): Promise<SidekickConversation>`

Opens Sidekick and sends `message` as the merchant's prompt. A string is shorthand for `{message}`. Call it from a merchant action, such as a button click. Shopify screens the prompt first and rejects with an error whose message starts with `sidekick.launch:` when it refuses to send it.

Used in: [useAppBridge()](/app-bridge/use-app-bridge), [`ShopifyGlobal`](/app-bridge/types/#shopifyglobal)

### `SidekickConversation` {#sidekickconversation}

The conversation a launch started or continued.

Import: `import type { SidekickConversation } from 'polaris-vue-elements/app-bridge'`

`id: string`

The conversation ID.

Used in: [`SidekickApi`](#sidekickapi)

### `SidekickLaunchRequest` {#sidekicklaunchrequest}

A request to start a Sidekick conversation from your app.

Import: `import type { SidekickLaunchRequest } from 'polaris-vue-elements/app-bridge'`

`message: string`

The prompt to send to Sidekick as the merchant's message. Required, and must be non-empty after trimming. Shopify trims surrounding whitespace and rejects a prompt longer than a merchant could type into Sidekick.

Used in: [`SidekickApi`](#sidekickapi)

## `SupportApi` {#supportapi}

`registerHandler?: (callback: SupportCallback | null) => Promise<void>`

Registers a callback function to run when the merchant clicks the support button. Pass `null` to unregister a previously registered handler.

Used in: [useAppBridge()](/app-bridge/use-app-bridge), [`ShopifyGlobal`](/app-bridge/types/#shopifyglobal)

### `SupportCallback` {#supportcallback}

```ts
type SupportCallback = () => void | Promise<void>;
```

Used in: [`SupportApi`](#supportapi)

## `ToastApi` {#toastapi}

`show: ToastShow`

Displays a Toast notification in the Shopify admin.

`hide: ToastHide`

Hides a Toast notification in the Shopify admin.

Used in: [useAppBridge()](/app-bridge/use-app-bridge), [`ShopifyGlobal`](/app-bridge/types/#shopifyglobal)

### `ToastHide` {#toasthide}

```ts
type ToastHide = (id: string) => void;
```

Used in: [`ToastApi`](#toastapi)

### `ToastShow` {#toastshow}

```ts
type ToastShow = (message: string, opts?: ToastOptions) => string;
```

References: [`ToastOptions`](#toastoptions)
Used in: [`ToastApi`](#toastapi)

### `ToastOptions` {#toastoptions}

Import: `import type { ToastOptions } from 'polaris-vue-elements/app-bridge'`

`duration?: number`

The length of time in milliseconds the toast message should persist.

Default: `5000`

`isError?: boolean`

Display an error-styled toast.

Default: `false`

`action?: string`

Content of an action button.

`onAction?: () => void`

Callback fired when the action button is clicked.

`onDismiss?: () => void`

Callback fired when the dismiss icon is clicked.

Used in: [useAppBridge()](/app-bridge/use-app-bridge), [`ToastShow`](#toastshow)

## `Tools` {#tools}

`register: RegisterFunction`

`unregister: UnregisterFunction`

`clear: ClearFunction`

Used in: [useAppBridge()](/app-bridge/use-app-bridge), [`ShopifyGlobal`](/app-bridge/types/#shopifyglobal)

### `ClearFunction` {#clearfunction}

```ts
type ClearFunction = () => void;
```

Used in: [`Tools`](#tools)

### `RegisterFunction` {#registerfunction}

```ts
type RegisterFunction = (name: string, handler: ToolHandler) => () => void;
```

References: [`ToolHandler`](#toolhandler)
Used in: [`Tools`](#tools)

### `UnregisterFunction` {#unregisterfunction}

```ts
type UnregisterFunction = (name: string) => void;
```

Used in: [`Tools`](#tools)

### `ToolHandler` {#toolhandler}

```ts
type ToolHandler = (input: Record<string, any>) => Record<string, any> | Promise<Record<string, any>>;
```

Used in: [`RegisterFunction`](#registerfunction)
