Skip to content

Бета

Эти компоненты App Bridge новые, и их API может измениться в минорном релизе, пока они в бете. Их поведение проверяется в реальной админке Shopify локальным E2E-набором. Если что-то не работает, создайте issue.

Пользовательский интерфейс и взаимодействия ​

API, которые Shopify относит к пользовательскому интерфейсу и взаимодействиям, и типы, которые использует только они. На этой странице: IntentsApi, LoadingApi, ModalApi, PickerApi, ResourcePickerApi, ReviewsApi, SaveBarApi, SidekickApi, SupportApi, ToastApi, Tools.

IntentsApi ​

interface

Расширяет: PublicIntentsApi

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

В типах не описано.

Используется в: useAppBridge(), ShopifyGlobal

Intent ​

interface

readonly action: string

В типах не описано.

readonly type: string

В типах не описано.

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

В типах не описано.

finish: Finish

В типах не описано.

Используется в: IntentsApi

PublicIntentsApi ​

interface

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.

Используется в: IntentsApi

Finish ​

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

Используется в: Intent

IntentActivity ​

interface

complete?: Promise<IntentResponse>

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

Используется в: PublicIntentsApi

IntentQuery ​

interface

Расширяет: IntentQueryOptions

action: IntentAction

В типах не описано.

type: IntentType

В типах не описано.

Используется в: PublicIntentsApi

IntentQueryOptions ​

interface

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' }

Используется в: IntentQuery, PublicIntentsApi

IntentRequestApi ​

interface

readonly value: IntentRequest | null

В типах не описано.

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

В типах не описано.

Используется в: PublicIntentsApi

IntentResponseApi ​

interface

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.

Используется в: PublicIntentsApi

IntentResponse ​

type
ts
type IntentResponse = ClosedIntentResponse | SuccessIntentResponse | ErrorIntentResponse;

Ссылки на: ClosedIntentResponse, ErrorIntentResponse, SuccessIntentResponseИспользуется в: IntentActivity

IntentAction ​

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

Используется в: IntentQuery

IntentType ​

type
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";

Используется в: IntentQuery

IntentRequest ​

interface

action: string

В типах не описано.

type: string

В типах не описано.

value?: unknown

В типах не описано.

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

В типах не описано.

Используется в: IntentRequestApi

SuccessIntentResponse ​

interface

code?: "ok"

В типах не описано.

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

В типах не описано.

Используется в: IntentResponse, IntentResponseApi

ClosedIntentResponse ​

interface

code?: "closed"

В типах не описано.

Используется в: IntentResponse

ErrorIntentResponse ​

interface

code?: "error"

В типах не описано.

message?: string

В типах не описано.

issues?: StandardSchemaV1.Issue[]

В типах не описано.

Используется в: IntentResponse

LoadingApi ​

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

Используется в: useAppBridge(), ShopifyGlobal

ModalApi ​

interface

Расширяет: Required<_ModalApi>

Используется в: useAppBridge(), Modal, ShopifyGlobal

_ModalApi ​

interface

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.

Используется в: ModalApi

PickerApi ​

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

Ссылки на: PickerOptionsИспользуется в: useAppBridge(), ShopifyGlobal

PickerOptions ​

interface

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).

По умолчанию: 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.

Используется в: PickerApi

interface

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).

По умолчанию: 'string'

Используется в: PickerOptions

PickerItem ​

interface

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.

По умолчанию: 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.

Используется в: PickerOptions

Badge ​

interface

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.

Используется в: PickerItem

DataPoint ​

type
ts
type DataPoint = string | number | undefined;

Используется в: PickerItem

Progress ​

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

Используется в: Badge

Tone ​

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

Используется в: Badge

ResourcePickerApi ​

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

Ссылки на: ResourcePickerOptions, ResourceTypes, SelectPayloadИспользуется в: useAppBridge(), ShopifyGlobal

ResourcePickerOptions ​

interface

Параметры типа: 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.

По умолчанию: '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.

По умолчанию: false

query?: string

Initial GraphQL search query for filtering resources available in the resource picker. See 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.

По умолчанию: ''

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.

По умолчанию: []

Используется в: useAppBridge(), ResourcePickerApi

ResourceTypes ​

type

product: Product

В типах не описано.

variant: ProductVariant

В типах не описано.

collection: Collection

В типах не описано.

SelectPayload ​

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

Ссылки на: ResourceSelection, ResourceTypes, WithSelectionИспользуется в: ResourcePickerApi

BaseResource ​

interface

Расширяет: Resource

variants?: Resource[]

В типах не описано.

Используется в: ResourcePickerOptions

Filters ​

interface

hidden?: boolean

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

По умолчанию: true

variants?: boolean

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

По умолчанию: true

draft?: boolean | undefined

Whether to show draft products. Only applies to the Product resource type picker. Setting this to undefined will show a badge on draft products.

По умолчанию: true

archived?: boolean | undefined

Whether to show archived products. Only applies to the Product resource type picker. Setting this to undefined will show a badge on draft products.

По умолчанию: true

query?: string

GraphQL initial search query for filtering resources available in the picker. See 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.

Используется в: ResourcePickerOptions

Collection ​

interface

Импорт: import type { Collection } from 'polaris-vue-elements/app-bridge'

Расширяет: 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

В типах не описано.

Используется в: ResourceTypes

Product ​

interface

Импорт: import type { Product } from 'polaris-vue-elements/app-bridge'

Расширяет: 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

В типах не описано.

Используется в: ProductVariant, ResourceTypes

ProductVariant ​

interface

Импорт: import type { ProductVariant } from 'polaris-vue-elements/app-bridge'

Расширяет: 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

В типах не описано.

Используется в: Product, ResourceTypes

ResourceSelection ​

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

Ссылки на: ResourceTypesИспользуется в: SelectPayload

WithSelection ​

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

Используется в: SelectPayload

Resource ​

interface

id: string

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

Используется в: BaseResource, Collection, Product, ProductVariant

CollectionSortOrder ​

enum
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"
}

Используется в: Collection

Image ​

interface

id: string

В типах не описано.

altText?: string

В типах не описано.

originalSrc: string

В типах не описано.

Используется в: Collection, Product, ProductVariant

RuleSet ​

interface

appliedDisjunctively: boolean

В типах не описано.

rules: CollectionRule[]

В типах не описано.

Используется в: Collection

ProductStatus ​

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

Используется в: Product

FulfillmentServiceType ​

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

Используется в: ProductVariant

Money ​

type
ts
type Money = string;

Используется в: ProductVariant

ProductVariantInventoryManagement ​

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

Используется в: ProductVariant

ProductVariantInventoryPolicy ​

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

Используется в: ProductVariant

WeightUnit ​

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

Используется в: ProductVariant

CollectionRule ​

interface

column: string

В типах не описано.

condition: string

В типах не описано.

relation: string

В типах не описано.

Используется в: RuleSet

ReviewsApi ​

interface

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.

Используется в: useAppBridge(), ShopifyGlobal

ReviewRequestResponse ​

type
ts
type ReviewRequestResponse = ReviewRequestSuccessResponse | ReviewRequestDeclinedResponse;

Ссылки на: ReviewRequestDeclinedResponse, ReviewRequestSuccessResponseИспользуется в: ReviewsApi

ReviewRequestDeclinedResponse ​

interface

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.

Используется в: ReviewRequestResponse

ReviewRequestSuccessResponse ​

interface

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.

Используется в: ReviewRequestResponse

ReviewRequestDeclinedCode ​

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

Используется в: ReviewRequestDeclinedResponse

SaveBarApi ​

interface

Расширяет: Required<_SaveBarApi>

Используется в: useAppBridge(), ShopifyGlobal

_SaveBarApi ​

interface

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.

Используется в: SaveBarApi

SidekickApi ​

interface

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.

Используется в: useAppBridge(), ShopifyGlobal

SidekickConversation ​

interface

The conversation a launch started or continued.

Импорт: import type { SidekickConversation } from 'polaris-vue-elements/app-bridge'

id: string

The conversation ID.

Используется в: SidekickApi

SidekickLaunchRequest ​

interface

A request to start a Sidekick conversation from your app.

Импорт: 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.

Используется в: SidekickApi

SupportApi ​

interface

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.

Используется в: useAppBridge(), ShopifyGlobal

SupportCallback ​

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

Используется в: SupportApi

ToastApi ​

interface

show: ToastShow

Displays a Toast notification in the Shopify admin.

hide: ToastHide

Hides a Toast notification in the Shopify admin.

Используется в: useAppBridge(), ShopifyGlobal

ToastHide ​

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

Используется в: ToastApi

ToastShow ​

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

Ссылки на: ToastOptionsИспользуется в: ToastApi

ToastOptions ​

interface

Импорт: import type { ToastOptions } from 'polaris-vue-elements/app-bridge'

duration?: number

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

По умолчанию: 5000

isError?: boolean

Display an error-styled toast.

По умолчанию: 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.

Используется в: useAppBridge(), ToastShow

Tools ​

interface

register: RegisterFunction

В типах не описано.

unregister: UnregisterFunction

В типах не описано.

clear: ClearFunction

В типах не описано.

Используется в: useAppBridge(), ShopifyGlobal

ClearFunction ​

function
ts
type ClearFunction = () => void;

Используется в: Tools

RegisterFunction ​

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

Ссылки на: ToolHandlerИспользуется в: Tools

UnregisterFunction ​

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

Используется в: Tools

ToolHandler ​

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

Используется в: RegisterFunction

Распространяется по лицензии MIT. Логотип Vue — Evan You, CC BY-NC-SA 4.0.