Upgrade to the latest API version and Polaris web components
This guide explains the steps you need to take to migrate your customer account UI extensions to the latest API version, including the removal of checkout metafield write types.
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 order metafieldsStep 2: Migrate to order metafields
In 2026-04, checkout metafields in the metafields API is replaced by order metafields in the appMetafields API.
To set an order metafield during checkout, you must have an extension using a pre-purchase Checkout UI extension target and use the applyMetafieldChange Metafield API to write a cart metafield that has the cart_to_order_copyable capability. See this guide for detailed instructions.
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 configuration for more details.
shopify.extension.toml
Anchor to Update API callsUpdate API calls
Instead of reading metafields using the shopify.metafields API or useMetafield, use shopify.appMetafields to read order metafield values.
Before migration: using metafields API (now removed)
package.json
tsx
After migration: using appMetafields for order metafields
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 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 the dependencies in your package.json file and re-install.
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 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 Cart Line Target 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 to web componentsMigrate to web components
Web components are exposed as custom HTML elements. Update your React or JavaScript components to custom elements.