Skip to main content
Migrate to Polaris

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.

Authentication State API

The Authentication State API provides the buyer's current authentication status in customer accounts. Use it to conditionally render content based on whether the buyer is fully signed in or viewing through a tokenized link.

  • Conditional content rendering: Show different UI depending on whether the buyer is fully authenticated or viewing the page through a pre-authenticated link.
  • Prompt for sign-in: Detect when a buyer is pre-authenticated and display a message encouraging them to sign in for a richer experience.
  • Protect sensitive data: Only display detailed customer information when the buyer is fully authenticated.

The Authentication State API object provides the buyer's authentication state. Access the following properties on the API object to read authentication data.

Anchor to authenticationState
authenticationState
StatefulRemoteSubscribable<>
required

The buyer's current authentication state on the Order status page. The value is either 'fully_authenticated' (the buyer is logged in) or 'pre_authenticated' (the buyer is viewing through a tokenized link).


  • Gate sensitive actions behind full authentication: Use the authentication state to restrict actions like editing order details to fully authenticated buyers.
  • Provide fallback content for pre-authenticated buyers: Pre-authenticated buyers access the page through a tokenized link. Show limited information and offer a sign-in prompt for additional actions.

  • The authentication state is read-only. You can't change the buyer's authentication level directly — use the Require Login API to prompt them to log in.
  • Pre-authenticated buyers may have limited access to protected customer data, which can cause some API properties to return undefined.

Was this page helpful?