Skip to main content

Extension
API

The API for interacting with the metadata of an extension.

The base API object provided to this and other customer-account extension targets.

required

Meta information about the extension.

Was this section helpful?

Returns the metadata of the extension.

Extension

apiVersion

The API version that was set in the extension config file.

capabilities
StatefulRemoteSubscribable<[]>

The allowed capabilities of the extension, defined in your shopify.ui.extension.toml file.

  • api_access: the extension can access the Storefront API.

  • network_access: the extension can make external network calls.

  • block_progress: the extension can block a buyer's progress and the merchant has allowed this blocking behavior.

rendered
StatefulRemoteSubscribable<boolean>

Whether your extension is currently rendered to the screen.

Shopify might render your extension before it's visible in the UI, typically to pre-render extensions that will appear on a later step of the checkout.

Your extension might also continue to run after the buyer has navigated away from where it was rendered. The extension continues running so that your extension is immediately available to render if the buyer navigates back.

scriptUrl
string

The URL to the script that started the extension target.

target
Target

The identifier that specifies where in Shopify’s UI your code is being injected. This will be one of the targets you have included in your extension’s configuration file.

editor

Information about the editor where the extension is being rendered.

The value is undefined if the extension is not rendering in an editor.

version
string

The published version of the running extension target.

For unpublished extensions, the value is undefined.

Was this section helpful?

Anchor to useExtensionEditor
useExtensionEditor()

Returns information about the editor where the extension is being rendered.

| undefined
Was this section helpful?