Version 2025-07 is the last API version to support React-based UI components. Later versions use web components, native UI elements with built-in accessibility, better performance, and consistent styling with Shopify's design system. Check out the migration guide to upgrade your extension.
Session Token API
The Session Token API lets you authenticate requests from your extension to your app's backend using a signed JSON Web Token (JWT). Use this API to get a token that your backend can verify using your app's shared secret, confirming the request came from a legitimate Shopify extension.
Anchor to Use casesUse cases
- Authenticate backend requests: Pass a session token as a Bearer token in API calls to your app's backend so you can verify the request came from your extension.
- Identify the customer: Read the optional
subclaim in the token to get the customer's GID when they're signed in and your app has access to protected customer data. - Verify the shop: Use the
destclaim to confirm which shop the request is associated with, ensuring your backend responds with the correct data.
Supported targets
- Customer
Account::Kitchen Sink - 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::Kitchen Sink - 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 Session Token API object provides session token functionality for customer account extensions. Access the following properties on the API object to retrieve signed tokens for authenticating requests to your app's backend.
- Anchor to sessionTokensessionTokensessionTokenSessionTokenSessionTokenrequiredrequired
Provides access to session tokens for verifying requests from your extension to your app's backend. Session tokens are signed JSON Web Tokens (JWTs) that contain information about the current session. For more details, see the Session Token API.
SessionToken
Provides access to session tokens for verifying requests from your extension to your app's backend. Session tokens are signed [JSON Web Tokens (JWTs)](https://jwt.io/) that contain information about the current session. For more details, see the [Session Token API](/docs/api/customer-account-ui-extensions/2025-07/apis/session-token).
- get
Requests a session token that hasn't expired. Call this method every time you need to make a request to your backend to get a valid token. Returns cached tokens when possible, so you don't need to store tokens yourself.
() => Promise<string>
Anchor to Best practicesBest practices
- Request tokens close to usage: Call
shopify.sessionToken.get()immediately before making a request rather than storing the token for later, since tokens expire after 5 minutes. - Verify tokens server-side: Always validate the token signature, expiration (
exp), and audience (aud) on your backend using your app's shared secret. - Handle token errors gracefully: Wrap token retrieval and fetch calls in try-catch blocks so your extension can display a meaningful message if authentication fails.
Anchor to LimitationsLimitations
- Session tokens expire after 5 minutes. Your backend must handle expired tokens and your extension should request a new token for each request.
- The
subclaim is only present when the customer is signed in and your app has theread_customersscope. Don't rely on it being available in all contexts. - Session tokens are signed JWTs intended for your backend only. Don't expose sensitive claims to the customer or use them for client-side authorization decisions.