Skip to main content

Action Extension API

Requires the admin action component.

The Action Extension API lets you build action extensions that merchants access from the More actions menu on details and index pages. Use this API to create workflows for processing resources, configuring settings, or integrating with external systems.

  • Modal workflows: Build action extensions that display in modal overlays from More actions menus.
  • Resource context: Access the current resource (product, order, customer) to display contextual actions.
  • Bulk operations: Process multiple selected resources in bulk action workflows.
  • Modal control: Close modals programmatically after completing operations or saving data.
Support
Targets (23)

The shopify global object provides properties for action extensions that render in modal overlays. Access the following properties on shopify to interact with the current context, control the modal, and display picker dialogs.

required

Provides methods for authenticating calls to your app backend. Use the idToken() method to retrieve a signed JWT token that verifies the current user's identity for secure server-side operations.

Anchor to close
close
() => void
required

Closes the extension modal. Use this when your extension completes its task or the merchant wants to exit. Equivalent to clicking the close button in the overlay corner.

required

An array of currently viewed or selected resource identifiers. Use this to access the IDs of items in the current context, such as selected products in an index page or the product being viewed on a details page. The available IDs depend on the extension target and user interactions.

Anchor to extension
extension
{ target: ; }
required

The identifier of the running extension target. Use this to determine which target your extension is rendering in and conditionally adjust functionality or UI based on the extension context.

required

Utilities for translating content according to the current localization of the admin. Use these methods to provide translated strings that match the merchant's language preferences, ensuring your extension is accessible to a global audience.

Anchor to intents
intents
required

Provides information to the receiver of an intent. Use this to access data passed from other extensions or parts of the admin when your extension is launched through intent-based navigation.

Anchor to picker
picker
required

Opens a custom selection dialog with your app-specific data. Use the Picker API to define the picker's heading, items, headers, and selection behavior. Returns a Promise that resolves to a Picker object with a selected property for accessing the merchant's selection.

Anchor to query
query
< = unknown, Variables = { [key: string]: unknown; }>(query: string, options?: { variables?: Variables; version?: Omit<, "2023-04">; }) => Promise<{ data?: ; errors?: []; }>
required

Executes GraphQL queries against the GraphQL Admin API. Use this to fetch shop data, manage resources, or perform mutations. Queries are automatically authenticated with the current user's permissions. Optionally specify GraphQL variables and API version for your query.

Anchor to resourcePicker
resourcePicker
required

Opens the resource picker modal for selecting products, variants, or collections. Returns the selected resources when the user confirms their selection, or undefined if they cancel.

Anchor to storage
storage
required

Provides methods for persisting data in browser storage that is scoped to your extension. Use this to store user preferences, cache data, maintain state across sessions, or save temporary working data. Storage is persistent across page reloads and isolated per extension.


  • Check array length for bulk operations: When actions appear on index pages with bulk selection, api.data.selected can contain multiple resources. Check the array length and handle batch operations accordingly.
  • Use loading state on buttons: Modal actions don't show loading indicators automatically. Use the loading prop on button components during async operations to prevent duplicate submissions.

  • Action extensions must call api.close() to dismiss the modal. Modal actions remain open indefinitely until explicitly closed.
  • Modal overlays can't be resized. The modal dimensions are fixed by the Shopify admin.
  • Action extensions can't modify the page layout underneath the modal or persist UI after closing.
  • Multiple modals can't be stacked. Opening a picker or intent closes the current modal context temporarily.

Was this page helpful?