Upgrade to the latest API version and Polaris web components
This guide explains the steps you need to take to migrate your checkout UI extensions to the latest API version, including metafield APIs.
If you're upgrading from a version earlier than 2025-10, you'll need to adopt Polaris web components. Versions 2025-10 and later use web components by default.
If you're upgrading from a version earlier than 2025-10, you'll need to adopt Polaris web components. Versions 2025-10 and later use web components by default.
Anchor to Step 1: Update API versionStep 1: Update API version
Update the API version to the latest version in shopify.extension.toml (for example, 2026-04).
shopify.extension.toml
Anchor to Step 2: Migrate to cart metafieldsStep 2: Migrate to cart metafields
As of the 2026-04 API version, the metafields property is deprecated. Use shopify.appMetafields to access values that you previously read using shopify.metafields or the useMetafield() and useMetafields() hooks.
Use cart metafields and update them using MetafieldUpdateCartChange and MetafieldRemoveCartChange.
The useApplyMetafieldsChange() hook is deprecated, as well as the MetafieldRemoveChange and the MetafieldUpdateChange inputs to the applyMetafieldChange method.
See metafields API for more details.
write_orders scope and create a matching order metafield definition with the cart_to_order_copyable capability. For a step-by-step walkthrough, see the add a field to checkout tutorial.write_orders scope and create a matching order metafield definition with the cart_to_order_copyable capability. For a step-by-step walkthrough, see the add a field to checkout tutorial.Anchor to Request metafields in your extension TOMLRequest metafields in your extension TOML
Request metafields that your extension needs access to in your extension configuration using [[extensions.metafields]]. See configurations for more details.
shopify.extension.toml
Anchor to Update API callsUpdate API calls
Use shopify.appMetafields to read cart metafields. To write data, use cart metafield change types updateCartMetafield and removeCartMetafield.
Before: Checkout metafields (now removed)
package.json
tsx
After: App metafields and cart metafield change types
package.json
tsx
package.json
tsx
Anchor to Step 3: Adopt web components and PreactStep 3: Adopt web components and Preact
The following sections apply only if you're upgrading from a version earlier than 2025-10. If you're already using web components and Preact, you don't need to make any changes.
Anchor to Adjust package dependenciesAdjust package dependencies
For API versions 2025-10 and later, Shopify recommends Preact for UI extensions. Update your package.json file to specify the latest dependencies and re-install them.
New dependencies with Preact
package.json
New dependencies with Preact
Previous dependencies with React
package.json
Previous dependencies with React
Previous dependencies with JavaScript
package.json
Previous dependencies with JavaScript
package.json
New dependencies with Preact
Anchor to TypeScript configurationType Script configuration
Get full IntelliSense and auto-complete support by adding a config file for your extension at extensions/{extension-name}/tsconfig.json. You don't need to change your app's root tsconfig.json file.
New tsconfig.json
tsconfig.json
New tsconfig.json
Old tsconfig.json
tsconfig.json
Old tsconfig.json
tsconfig.json
New tsconfig.json
Anchor to Upgrade the Shopify CLIUpgrade the Shopify CLI
The new Shopify CLI adds support for building with web components.
The shopify app dev command runs your app and also generates a shopify.d.ts file in your extension directory, adding support for the new global shopify object.
Support new global shopify object
CLI
Anchor to Optional ESLint configurationOptional ESLint configuration
If your app is using ESLint, update your configuration to include the new global shopify object.
.eslintrc.cjs
Anchor to Migrate API callsMigrate API calls
Instead of accessing APIs from a callback parameter, access them from the global shopify object. Here's an example of migrating the applyAttributeChange API call.
New API calls in Preact
Preact
New API calls in Preact
Previous API calls in React
React
Previous API calls in React
Previous API calls in JavaScript
JavaScript
Previous API calls in JavaScript
Preact
New API calls in Preact
Anchor to Migrate hooksMigrate hooks
If you had previously been using React hooks, you can continue using them by importing those same hooks from a new Preact-specific package. Here's an example of migrating the useAttributeValues hook:
New hooks in Preact
Preact
New hooks in Preact
Previous hooks in React
React
Previous hooks in React
Preact
New hooks in Preact
For hooks that perform simple read or write operations, we recommend that you use the shopify global object instead. Some Preact hooks take parameters and are provided as convenience wrappers to make it easier to perform common operations without writing your own logic. These hooks are documented on the individual API reference pages in Target APIs.
For hooks that perform simple read or write operations, we recommend that you use the shopify global object instead. Some Preact hooks take parameters and are provided as convenience wrappers to make it easier to perform common operations without writing your own logic. These hooks are documented on the individual API reference pages in Target APIs.
Anchor to Migrate to web componentsMigrate to web components
Web components are exposed as custom HTML elements. Update your React or JavaScript components to custom elements.