User interface और interactions
वे APIs जिन्हें Shopify user interface और interactions में रखता है, और वे types जिन्हें सिर्फ़ ये इस्तेमाल करते हैं। इस page पर: IntentsApi, LoadingApi, ModalApi, PickerApi, ResourcePickerApi, ReviewsApi, SaveBarApi, SidekickApi, SupportApi, ToastApi, Tools।
IntentsApi
register(callback: (intent: Intent) => void): () => void
Types में इसका विवरण नहीं है।
इनमें इस्तेमाल: useAppBridge(), ShopifyGlobal
Intent
readonly action: string
Types में इसका विवरण नहीं है।
readonly type: string
Types में इसका विवरण नहीं है।
readonly data: { [key: string]: any; }
Types में इसका विवरण नहीं है।
finish: Finish
Types में इसका विवरण नहीं है।
इनमें इस्तेमाल: IntentsApi
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.
इनमें इस्तेमाल: IntentsApi
IntentActivity
complete?: Promise<IntentResponse>
A Promise that resolves when the intent workflow completes, returning the response.
इनमें इस्तेमाल: PublicIntentsApi
IntentQuery
action: IntentAction
Types में इसका विवरण नहीं है।
type: IntentType
Types में इसका विवरण नहीं है।
इनमें इस्तेमाल: PublicIntentsApi
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' }
इनमें इस्तेमाल: IntentQuery, PublicIntentsApi
IntentRequestApi
readonly value: IntentRequest | null
Types में इसका विवरण नहीं है।
subscribe(callback: (value: IntentRequest | null) => void): () => void
Types में इसका विवरण नहीं है।
इनमें इस्तेमाल: PublicIntentsApi
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.
इनमें इस्तेमाल: PublicIntentsApi
IntentResponse
type IntentResponse = ClosedIntentResponse | SuccessIntentResponse | ErrorIntentResponse;References: ClosedIntentResponse, ErrorIntentResponse, SuccessIntentResponseइनमें इस्तेमाल: IntentActivity
IntentType
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
action: string
Types में इसका विवरण नहीं है।
type: string
Types में इसका विवरण नहीं है।
value?: unknown
Types में इसका विवरण नहीं है।
data?: { [key: string]: unknown; }
Types में इसका विवरण नहीं है।
इनमें इस्तेमाल: IntentRequestApi
SuccessIntentResponse
code?: "ok"
Types में इसका विवरण नहीं है।
data?: { [key: string]: unknown; }
Types में इसका विवरण नहीं है।
इनमें इस्तेमाल: IntentResponse, IntentResponseApi
ClosedIntentResponse
code?: "closed"
Types में इसका विवरण नहीं है।
इनमें इस्तेमाल: IntentResponse
ErrorIntentResponse
code?: "error"
Types में इसका विवरण नहीं है।
message?: string
Types में इसका विवरण नहीं है।
issues?: StandardSchemaV1.Issue[]
Types में इसका विवरण नहीं है।
इनमें इस्तेमाल: IntentResponse
LoadingApi
type LoadingApi = (isLoading?: boolean) => void;इनमें इस्तेमाल: useAppBridge(), ShopifyGlobal
ModalApi
इनमें इस्तेमाल: useAppBridge(), Modal, ShopifyGlobal
_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.
इनमें इस्तेमाल: ModalApi
PickerApi
type PickerApi = (options: PickerOptions) => Promise<{
selected: Promise<string[] | undefined>;
}>;References: PickerOptionsइनमें इस्तेमाल: useAppBridge(), ShopifyGlobal
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.
इनमें इस्तेमाल: PickerApi
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'
इनमें इस्तेमाल: PickerOptions
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.
इनमें इस्तेमाल: PickerOptions
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.
इनमें इस्तेमाल: PickerItem
Progress
type Progress = "incomplete" | "partiallyComplete" | "complete";इनमें इस्तेमाल: Badge
ResourcePickerApi
type ResourcePickerApi = <ResourceType extends keyof ResourceTypes = keyof ResourceTypes>(options: ResourcePickerOptions<ResourceType>) => Promise<SelectPayload<ResourceType> | undefined>;References: ResourcePickerOptions, ResourceTypes, SelectPayloadइनमें इस्तेमाल: useAppBridge(), ShopifyGlobal
ResourcePickerOptions
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 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: []
इनमें इस्तेमाल: useAppBridge(), ResourcePickerApi
ResourceTypes
product: Product
Types में इसका विवरण नहीं है।
variant: ProductVariant
Types में इसका विवरण नहीं है।
collection: Collection
Types में इसका विवरण नहीं है।
इनमें इस्तेमाल: ResourcePickerApi, ResourcePickerOptions, ResourceSelection, SelectPayload
SelectPayload
type SelectPayload<Type extends keyof ResourceTypes> = WithSelection<ResourceSelection<Type>[]>;References: ResourceSelection, ResourceTypes, WithSelectionइनमें इस्तेमाल: ResourcePickerApi
BaseResource
variants?: Resource[]
Types में इसका विवरण नहीं है।
इनमें इस्तेमाल: ResourcePickerOptions
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. 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. 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 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
availablePublicationCount: number
Types में इसका विवरण नहीं है।
description: string
Types में इसका विवरण नहीं है।
descriptionHtml: string
Types में इसका विवरण नहीं है।
handle: string
Types में इसका विवरण नहीं है।
id: string
Types में इसका विवरण नहीं है।
image?: Image | null
Types में इसका विवरण नहीं है।
productsAutomaticallySortedCount: number
Types में इसका विवरण नहीं है।
productsCount: number
Types में इसका विवरण नहीं है।
productsManuallySortedCount: number
Types में इसका विवरण नहीं है।
publicationCount: number
Types में इसका विवरण नहीं है।
ruleSet?: RuleSet | null
Types में इसका विवरण नहीं है।
seo: { description?: string | null; title?: string | null; }
Types में इसका विवरण नहीं है।
sortOrder: CollectionSortOrder
Types में इसका विवरण नहीं है।
storefrontId: string
Types में इसका विवरण नहीं है।
templateSuffix?: string | null
Types में इसका विवरण नहीं है।
title: string
Types में इसका विवरण नहीं है।
updatedAt: string
Types में इसका विवरण नहीं है।
इनमें इस्तेमाल: ResourceTypes
Product
availablePublicationCount: number
Types में इसका विवरण नहीं है।
createdAt: string
Types में इसका विवरण नहीं है।
descriptionHtml: string
Types में इसका विवरण नहीं है।
handle: string
Types में इसका विवरण नहीं है।
hasOnlyDefaultVariant: boolean
Types में इसका विवरण नहीं है।
images: Image[]
Types में इसका विवरण नहीं है।
options: { id: string; name: string; position: number; values: string[]; }[]
Types में इसका विवरण नहीं है।
productType: string
Types में इसका विवरण नहीं है।
publishedAt?: string | null
Types में इसका विवरण नहीं है।
tags: string[]
Types में इसका विवरण नहीं है।
templateSuffix?: string | null
Types में इसका विवरण नहीं है।
title: string
Types में इसका विवरण नहीं है।
totalInventory: number
Types में इसका विवरण नहीं है।
totalVariants: number
Types में इसका विवरण नहीं है।
tracksInventory: boolean
Types में इसका विवरण नहीं है।
variants: Partial<ProductVariant>[]
Types में इसका विवरण नहीं है।
vendor: string
Types में इसका विवरण नहीं है।
updatedAt: string
Types में इसका विवरण नहीं है।
status: ProductStatus
Types में इसका विवरण नहीं है।
इनमें इस्तेमाल: ProductVariant, ResourceTypes
ProductVariant
availableForSale: boolean
Types में इसका विवरण नहीं है।
barcode?: string | null
Types में इसका विवरण नहीं है।
compareAtPrice?: Money | null
Types में इसका विवरण नहीं है।
createdAt: string
Types में इसका विवरण नहीं है।
displayName: string
Types में इसका विवरण नहीं है।
fulfillmentService?: { id: string; inventoryManagement: boolean; productBased: boolean; serviceName: string; type: FulfillmentServiceType; }
Types में इसका विवरण नहीं है।
image?: Image | null
Types में इसका विवरण नहीं है।
inventoryItem: { id: string; }
Types में इसका विवरण नहीं है।
inventoryManagement: ProductVariantInventoryManagement
Types में इसका विवरण नहीं है।
inventoryPolicy: ProductVariantInventoryPolicy
Types में इसका विवरण नहीं है।
inventoryQuantity?: number | null
Types में इसका विवरण नहीं है।
position: number
Types में इसका विवरण नहीं है।
price: Money
Types में इसका विवरण नहीं है।
product: Partial<Product>
Types में इसका विवरण नहीं है।
requiresShipping: boolean
Types में इसका विवरण नहीं है।
selectedOptions: { value?: string | null; }[]
Types में इसका विवरण नहीं है।
sku?: string | null
Types में इसका विवरण नहीं है।
taxable: boolean
Types में इसका विवरण नहीं है।
title: string
Types में इसका विवरण नहीं है।
weight?: number | null
Types में इसका विवरण नहीं है।
weightUnit: WeightUnit
Types में इसका विवरण नहीं है।
updatedAt: string
Types में इसका विवरण नहीं है।
इनमें इस्तेमाल: Product, ResourceTypes
ResourceSelection
type ResourceSelection<Type extends keyof ResourceTypes> = ResourceTypes[Type];References: ResourceTypesइनमें इस्तेमाल: SelectPayload
Resource
id: string
in GraphQL id format, ie 'gid://shopify/Product/1'
इनमें इस्तेमाल: BaseResource, Collection, Product, ProductVariant
CollectionSortOrder
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
id: string
Types में इसका विवरण नहीं है।
altText?: string
Types में इसका विवरण नहीं है।
originalSrc: string
Types में इसका विवरण नहीं है।
इनमें इस्तेमाल: Collection, Product, ProductVariant
RuleSet
appliedDisjunctively: boolean
Types में इसका विवरण नहीं है।
rules: CollectionRule[]
Types में इसका विवरण नहीं है।
इनमें इस्तेमाल: Collection
ProductStatus
declare enum ProductStatus {
Active = "ACTIVE",
Archived = "ARCHIVED",
Draft = "DRAFT"
}इनमें इस्तेमाल: Product
FulfillmentServiceType
declare enum FulfillmentServiceType {
GiftCard = "GIFT_CARD",
Manual = "MANUAL",
ThirdParty = "THIRD_PARTY"
}इनमें इस्तेमाल: ProductVariant
ProductVariantInventoryManagement
declare enum ProductVariantInventoryManagement {
Shopify = "SHOPIFY",
NotManaged = "NOT_MANAGED",
FulfillmentService = "FULFILLMENT_SERVICE"
}इनमें इस्तेमाल: ProductVariant
ProductVariantInventoryPolicy
declare enum ProductVariantInventoryPolicy {
Deny = "DENY",
Continue = "CONTINUE"
}इनमें इस्तेमाल: ProductVariant
WeightUnit
declare enum WeightUnit {
Kilograms = "KILOGRAMS",
Grams = "GRAMS",
Pounds = "POUNDS",
Ounces = "OUNCES"
}इनमें इस्तेमाल: ProductVariant
CollectionRule
column: string
Types में इसका विवरण नहीं है।
condition: string
Types में इसका विवरण नहीं है।
relation: string
Types में इसका विवरण नहीं है।
इनमें इस्तेमाल: RuleSet
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.
इनमें इस्तेमाल: useAppBridge(), ShopifyGlobal
ReviewRequestResponse
type ReviewRequestResponse = ReviewRequestSuccessResponse | ReviewRequestDeclinedResponse;References: ReviewRequestDeclinedResponse, ReviewRequestSuccessResponseइनमें इस्तेमाल: ReviewsApi
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.
इनमें इस्तेमाल: ReviewRequestResponse
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.
इनमें इस्तेमाल: ReviewRequestResponse
ReviewRequestDeclinedCode
type ReviewRequestDeclinedCode = "mobile-app" | "already-reviewed" | "annual-limit-reached" | "cooldown-period" | "merchant-ineligible" | "recently-installed" | "already-open" | "open-in-progress" | "cancelled";इनमें इस्तेमाल: ReviewRequestDeclinedResponse
SaveBarApi
इनमें इस्तेमाल: useAppBridge(), ShopifyGlobal
_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.
इनमें इस्तेमाल: SaveBarApi
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.
इनमें इस्तेमाल: useAppBridge(), ShopifyGlobal
SidekickConversation
The conversation a launch started or continued.
id: string
The conversation ID.
इनमें इस्तेमाल: SidekickApi
SidekickLaunchRequest
A request to start a Sidekick conversation from your app.
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
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
type SupportCallback = () => void | Promise<void>;इनमें इस्तेमाल: SupportApi
ToastApi
show: ToastShow
Displays a Toast notification in the Shopify admin.
hide: ToastHide
Hides a Toast notification in the Shopify admin.
इनमें इस्तेमाल: useAppBridge(), ShopifyGlobal
ToastShow
type ToastShow = (message: string, opts?: ToastOptions) => string;References: ToastOptionsइनमें इस्तेमाल: ToastApi
ToastOptions
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.
इनमें इस्तेमाल: useAppBridge(), ToastShow
Tools
register: RegisterFunction
Types में इसका विवरण नहीं है।
unregister: UnregisterFunction
Types में इसका विवरण नहीं है।
clear: ClearFunction
Types में इसका विवरण नहीं है।
इनमें इस्तेमाल: useAppBridge(), ShopifyGlobal
RegisterFunction
type RegisterFunction = (name: string, handler: ToolHandler) => () => void;References: ToolHandlerइनमें इस्तेमाल: Tools
UnregisterFunction
type UnregisterFunction = (name: string) => void;इनमें इस्तेमाल: Tools
ToolHandler
type ToolHandler = (input: Record<string, any>) => Record<string, any> | Promise<Record<string, any>>;इनमें इस्तेमाल: RegisterFunction