Skip to main content

Extension
API

The API for interacting with the metadata of an extension.

The base API object provided to purchase, and customer-account.order-status extension targets.

<Target>
required

Meta information about the extension.

Was this section helpful?

Returns the metadata about 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.extension.toml file.

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 useExtensionData
useExtensionData()

Returns the metadata about the extension. This is deprecated, use useExtension() instead.

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.extension.toml file.

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 useExtensionCapabilities
useExtensionCapabilities()

Returns a list of an extension's granted capabilities.

[]
Was this section helpful?

Returns whether or not a given capability of an extension is granted.

required

Was this section helpful?

Anchor to useExtensionEditor
useExtensionEditor()

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

| undefined
Was this section helpful?