Version API
The Version API lets you read the current API version your extension is running on. Use this API to implement version-specific logic, log the active version for debugging, or conditionally enable features that depend on a specific API version.
Anchor to Use casesUse cases
- Apply version-specific behavior: Check the API version at runtime to enable or disable features that are only available in certain versions.
- Log the active version for debugging: Include the API version in logs or error reports to help diagnose issues across different environments.
- Display version information: Show the current API version in a diagnostic or admin-facing view to help with troubleshooting.
Supported targets
- customer-account.
footer. render-after - customer-account.
order-index. announcement. render - customer-account.
order-index. block. render - customer-account.
order-status. announcement. render - customer-account.
order-status. block. render - customer-account.
order-status. cart-line-item. render-after - customer-account.
order-status. cart-line-list. render-after - customer-account.
order-status. customer-information. render-after - customer-account.
order-status. fulfillment-details. render-after - customer-account.
order-status. payment-details. render-after - customer-account.
order-status. return-details. render-after - customer-account.
order-status. unfulfilled-items. render-after - customer-account.
order. action. menu-item. render - customer-account.
order. action. render - customer-account.
order. page. render - customer-account.
page. render - customer-account.
profile. addresses. render-after - customer-account.
profile. announcement. render - customer-account.
profile. block. render - customer-account.
profile. company-details. render-after - customer-account.
profile. company-location-addresses. render-after - customer-account.
profile. company-location-payment. render-after - customer-account.
profile. company-location-staff. render-after - customer-account.
profile. payment. render-after
Supported targets
- customer-account.
footer. render-after - customer-account.
order-index. announcement. render - customer-account.
order-index. block. render - customer-account.
order-status. announcement. render - customer-account.
order-status. block. render - customer-account.
order-status. cart-line-item. render-after - customer-account.
order-status. cart-line-list. render-after - customer-account.
order-status. customer-information. render-after - customer-account.
order-status. fulfillment-details. render-after - customer-account.
order-status. payment-details. render-after - customer-account.
order-status. return-details. render-after - customer-account.
order-status. unfulfilled-items. render-after - customer-account.
order. action. menu-item. render - customer-account.
order. action. render - customer-account.
order. page. render - customer-account.
page. render - customer-account.
profile. addresses. render-after - customer-account.
profile. announcement. render - customer-account.
profile. block. render - customer-account.
profile. company-details. render-after - customer-account.
profile. company-location-addresses. render-after - customer-account.
profile. company-location-payment. render-after - customer-account.
profile. company-location-staff. render-after - customer-account.
profile. payment. render-after
Anchor to PropertiesProperties
The shopify global object provides the API version for customer account extensions. Access the following properties on shopify to determine which version your extension is running against.
- Anchor to versionversionversionVersionVersionrequiredrequired
The API version your extension is running against. Use this to conditionally enable features or handle breaking changes when your extension supports multiple API versions.
Version
stringjsx
Examples
Description
Access the API version string that your extension is running on. This example reads `shopify.version` and displays it in a text component.
jsx
import '@shopify/ui-extensions/preact'; import {render} from 'preact'; export default async () => { render(<Extension />, document.body); }; function Extension() { const version = shopify.version; return ( <s-text> Running on API version: {version} </s-text> ); }Description
Conditionally render content based on the API version to handle feature availability across versions. This example compares `shopify.version` against a minimum version string to decide which banner to display.
jsx
import '@shopify/ui-extensions/preact'; import {render} from 'preact'; export default async () => { render(<Extension />, document.body); }; function Extension() { const version = shopify.version; const supportsNewFeature = version >= '2026-04'; return ( <s-stack direction="block" gap="base"> {supportsNewFeature ? ( <s-banner heading="New feature available"> This extension is using the latest API features. </s-banner> ) : ( <s-banner heading="Update available"> Upgrade your API version to access new features. </s-banner> )} </s-stack> ); }
Anchor to Best practicesBest practices
- Don't over-rely on version checks: Prefer feature detection over version comparison when possible. Version checks can become brittle as APIs evolve.
- Use version info for debugging: Include
shopify.versionin error logs or diagnostic output to make it easier to reproduce and triage issues. - Keep version comparisons simple: Compare version strings using straightforward logic. Version strings follow a
YYYY-MMformat that supports lexicographic comparison.
Anchor to LimitationsLimitations
- The version string reflects the API version your extension is configured to use, not the latest available version. It won't change unless you update your extension's configuration.
- The Version API is read-only. You can't change the API version at runtime. It's determined by the
api_versionfield in yourshopify.extension.tomlfile.