ExtensionAPI
The API for interacting with the metadata of an extension.
Anchor to standardapiStandardApi
The base API object provided to purchase
extension targets.
- Anchor to extensionextension<Target>required
The meta information about the extension.
Docs_Standard_ExtensionMetaApi
- extension
The meta information about the extension.
Extension<Target>
export interface Docs_Standard_ExtensionMetaApi
extends Pick<StandardApi, 'extension'> {}
Extension
The meta information about an extension target.
- apiVersion
The API version that was set in the extension config file.
ApiVersion
- capabilities
The allowed capabilities of the extension, defined in your [shopify.extension.toml](/docs/api/checkout-ui-extensions/configuration) file. * [`api_access`](/docs/api/checkout-ui-extensions/configuration#api-access): the extension can access the Storefront API. * [`network_access`](/docs/api/checkout-ui-extensions/configuration#network-access): the extension can make external network calls. * [`block_progress`](/docs/api/checkout-ui-extensions/configuration#block-progress): the extension can block a customer's progress and the merchant has allowed this blocking behavior. * [`collect_buyer_consent.sms_marketing`](/docs/api/checkout-ui-extensions/configuration#collect-buyer-consent): the extension can collect customer consent for SMS marketing. * [`collect_buyer_consent.customer_privacy`](/docs/api/checkout-ui-extensions/configuration#collect-buyer-consent): the extension can register customer consent decisions that will be honored on Shopify-managed services. * [`iframe.sources`](/docs/api/checkout-ui-extensions/configuration#iframe): the extension can embed an external URL in an iframe.
StatefulRemoteSubscribable<Capability[]>
- editor
Information about the editor where the extension is being rendered. If the value is undefined, then the extension is not running in an editor.
Editor
- rendered
A Boolean to show 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 customer has navigated away from where it was rendered. The extension continues running so that your extension is immediately available to render if the customer navigates back.
StatefulRemoteSubscribable<boolean>
- scriptUrl
The URL to the script that started the extension target.
string
- 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.
Target
- version
The published version of the running extension target. For unpublished extensions, the value is `undefined`.
string
export interface Extension<Target extends ExtensionTarget = ExtensionTarget> {
/**
* The API version that was set in the extension config file.
*
* @example '2024-07', '2024-10', '2025-01', '2025-04', 'unstable'
*/
apiVersion: ApiVersion;
/**
* The allowed capabilities of the extension, defined
* in your [shopify.extension.toml](/docs/api/checkout-ui-extensions/configuration) file.
*
* * [`api_access`](/docs/api/checkout-ui-extensions/configuration#api-access): the extension can access the Storefront API.
*
* * [`network_access`](/docs/api/checkout-ui-extensions/configuration#network-access): the extension can make external network calls.
*
* * [`block_progress`](/docs/api/checkout-ui-extensions/configuration#block-progress): the extension can block a customer's progress and the merchant has allowed this blocking behavior.
*
* * [`collect_buyer_consent.sms_marketing`](/docs/api/checkout-ui-extensions/configuration#collect-buyer-consent): the extension can collect customer consent for SMS marketing.
*
* * [`collect_buyer_consent.customer_privacy`](/docs/api/checkout-ui-extensions/configuration#collect-buyer-consent): the extension can register customer consent decisions that will be honored on Shopify-managed services.
*
* * [`iframe.sources`](/docs/api/checkout-ui-extensions/configuration#iframe): the extension can embed an external URL in an iframe.
*/
capabilities: StatefulRemoteSubscribable<Capability[]>;
/**
* Information about the editor where the extension is being rendered.
*
* If the value is undefined, then the extension is not running in an editor.
*/
editor?: Editor;
/**
* A Boolean to show 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 customer has navigated away
* from where it was rendered. The extension continues running so that
* your extension is immediately available to render if the customer navigates back.
*/
rendered: StatefulRemoteSubscribable<boolean>;
/**
* The URL to the script that started the extension target.
*/
scriptUrl: string;
/**
* 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.
*
* @example 'purchase.checkout.block.render'
* @see /docs/api/checkout-ui-extensions/2025-07/extension-targets-overview
* @see /docs/apps/app-extensions/configuration#targets
*/
target: Target;
/**
* The published version of the running extension target.
*
* For unpublished extensions, the value is `undefined`.
*
* @example 3.0.10
*/
version?: string;
}
ApiVersion
Union of supported API versions
'2023-04' | '2023-07' | '2023-10' | '2024-01' | '2024-04' | '2024-07' | '2024-10' | '2025-01' | '2025-04' | 'unstable'
Capability
The capabilities an extension has access to. * [`api_access`](/docs/api/checkout-ui-extensions/configuration#api-access): the extension can access the Storefront API. * [`network_access`](/docs/api/checkout-ui-extensions/configuration#network-access): the extension can make external network calls. * [`block_progress`](/docs/api/checkout-ui-extensions/configuration#block-progress): the extension can block a buyer's progress and the merchant has allowed this blocking behavior. * [`collect_buyer_consent.sms_marketing`](/docs/api/checkout-ui-extensions/configuration#collect-buyer-consent): the extension can collect buyer consent for SMS marketing. * [`collect_buyer_consent.customer_privacy`](/docs/api/checkout-ui-extensions/configuration#collect-buyer-consent): the extension can register buyer consent decisions that will be honored on Shopify-managed services. * [`iframe.sources`](/docs/api/checkout-ui-extensions/configuration#iframe): the extension can embed an external URL in an iframe.
'api_access' | 'network_access' | 'block_progress' | 'collect_buyer_consent.sms_marketing' | 'collect_buyer_consent.customer_privacy' | 'iframe.sources'
Editor
- type
Indicates whether the extension is rendering in the checkout editor.
"checkout"
export interface Editor {
/**
* Indicates whether the extension is rendering in the checkout editor.
*/
type: 'checkout';
}
Anchor to useExtensionuse Extension()
Returns the metadata about the extension.
UseExtensionGeneratedType
Returns the metadata about the extension.
Extension
export function useExtension(): Extension {
return useApi().extension as Extension;
}
Anchor to useExtensionDatause Extension Data()
Returns the metadata about the extension. This is deprecated, use instead.
UseExtensionDataGeneratedType
Returns the metadata about the extension. > Caution: This is deprecated, use `useExtension()` instead.
Extension
export function useExtensionData(): Extension {
return useExtension();
}
Anchor to useExtensionCapabilitiesuse Extension Capabilities()
Returns a list of an extension's granted capabilities.
UseExtensionCapabilitiesGeneratedType
Returns a list of an extension's granted capabilities.
Capability[]
export function useExtensionCapabilities(): Capability[] {
return useSubscription(useApi().extension.capabilities);
}
Capability
The capabilities an extension has access to. * [`api_access`](/docs/api/checkout-ui-extensions/configuration#api-access): the extension can access the Storefront API. * [`network_access`](/docs/api/checkout-ui-extensions/configuration#network-access): the extension can make external network calls. * [`block_progress`](/docs/api/checkout-ui-extensions/configuration#block-progress): the extension can block a buyer's progress and the merchant has allowed this blocking behavior. * [`collect_buyer_consent.sms_marketing`](/docs/api/checkout-ui-extensions/configuration#collect-buyer-consent): the extension can collect buyer consent for SMS marketing. * [`collect_buyer_consent.customer_privacy`](/docs/api/checkout-ui-extensions/configuration#collect-buyer-consent): the extension can register buyer consent decisions that will be honored on Shopify-managed services. * [`iframe.sources`](/docs/api/checkout-ui-extensions/configuration#iframe): the extension can embed an external URL in an iframe.
'api_access' | 'network_access' | 'block_progress' | 'collect_buyer_consent.sms_marketing' | 'collect_buyer_consent.customer_privacy' | 'iframe.sources'
Returns whether or not a given capability of an extension is granted.
- Anchor to capabilitycapabilityrequired
Anchor to useExtensionCapability-returnsReturnsboolean
UseExtensionCapabilityGeneratedType
Returns whether or not a given capability of an extension is granted.
- capability
Capability
boolean
export function useExtensionCapability(capability: Capability): boolean {
return useExtensionCapabilities().includes(capability);
}
Capability
The capabilities an extension has access to. * [`api_access`](/docs/api/checkout-ui-extensions/configuration#api-access): the extension can access the Storefront API. * [`network_access`](/docs/api/checkout-ui-extensions/configuration#network-access): the extension can make external network calls. * [`block_progress`](/docs/api/checkout-ui-extensions/configuration#block-progress): the extension can block a buyer's progress and the merchant has allowed this blocking behavior. * [`collect_buyer_consent.sms_marketing`](/docs/api/checkout-ui-extensions/configuration#collect-buyer-consent): the extension can collect buyer consent for SMS marketing. * [`collect_buyer_consent.customer_privacy`](/docs/api/checkout-ui-extensions/configuration#collect-buyer-consent): the extension can register buyer consent decisions that will be honored on Shopify-managed services. * [`iframe.sources`](/docs/api/checkout-ui-extensions/configuration#iframe): the extension can embed an external URL in an iframe.
'api_access' | 'network_access' | 'block_progress' | 'collect_buyer_consent.sms_marketing' | 'collect_buyer_consent.customer_privacy' | 'iframe.sources'
Anchor to useExtensionEditoruse Extension Editor()
Returns information about the editor where the extension is being rendered.
UseExtensionEditorGeneratedType
Returns information about the editor where the extension is being rendered.
Editor | undefined
export function useExtensionEditor(): Editor | undefined {
return useApi().extension.editor;
}
Editor
- type
Indicates whether the extension is rendering in the checkout editor.
"checkout"
export interface Editor {
/**
* Indicates whether the extension is rendering in the checkout editor.
*/
type: 'checkout';
}