Headless customer login

Topic summary

A developer building a headless Shopify storefront with Nuxt.js successfully retrieves products and collections via GraphQL but needs to implement customer login functionality to display order history.

Solution Provided:

  • Use the customerAccessTokenCreate mutation with email and password credentials
  • This returns a customerAccessToken object that can be used in subsequent queries/mutations
  • The token enables retrieving customer data, associating checkouts, and performing authenticated operations
  • Store the token client-side to maintain the session

Unresolved Questions:

  • Whether the token actually “logs in” the customer or just provides authentication for API calls
  • Feasibility of implementing JWT-based authentication using the returned customer access token
  • Confusion about token validity - one participant reports the token only works for mutations, not for logging users in, seeking alternative approaches

The discussion remains open with clarification needed on the token’s full capabilities and proper authentication flow.

Summarized with AI on November 12. AI used: claude-sonnet-4-5-20250929.

You can get a token by submitting that information to customerAccessTokenCreate

Docs: https://help.shopify.com/en/api/storefront-api/reference/mutation/customeraccesstokencreate

That token can be used to retrieve customer data, associate checkouts, etc

1 Like