Back to Spree

Auth Jwt Example

docs/snippets/store-api/auth-jwt-example.mdx

5.4.2267 B
Original Source
typescript
// Login to get a JWT token
const { token, user } = await client.auth.login({
  email: '[email protected]',
  password: 'password123',
})

// Use the token for authenticated requests
const orders = await client.customer.orders.list({}, { token })