Skip to main content

App API

The App API provides read-only access to extension information through the app.extensions() method, enabling discovery of installed extensions and their activation status. The method asynchronously retrieves detailed information including handles, types, and activations across different surfaces.

The method returns a Promise that resolves to an array of ExtensionInfo objects. Each object contains:

  • handle: The unique identifier for the extension
  • type: Either 'ui_extension' or 'theme_app_extension'
  • activations: Activation records (shape varies by extension type)

The array may be empty if the app has no extensions.

UI extensions have activations with a target field indicating the admin, checkout, customer account or point of sale target.

Theme app extensions have activations representing individual blocks/embeds, each with:

  • handle: Block/embed filename
  • name: Display name from block schema
  • target: Location type ('section', 'head', 'body', or 'compliance_head')
  • status: Availability status ('active', 'available', or 'unavailable')
  • activations: Array of theme-specific placements with target and themeId
Note

For theme app extensions, activation data is sourced from the store's published theme only.

  • Extension discovery: Discover installed extensions and check which extension targets are activated.
  • Activation status: Determine whether theme app extension blocks and embeds are active on specific templates.
  • Extension filtering: Filter extensions by type to separate UI extensions from theme app extensions.
  • Feature gating: Conditionally show features based on whether required extensions are installed and activated.

The app API is available on the shopify global object. The extensions method is asynchronous and returns a Promise that resolves to an array of ExtensionInfo objects.

Anchor to extensions
extensions
() => Promise<<>[]>
required

The list of extensions from the current app.


Was this page helpful?