Generates a new JWT token for the authenticated user
JavaScript
import { createClient } from '@spree/sdk' const client = createClient({ baseUrl: 'https://your-store.com', publishableKey: '<api-key>', }) const auth = await client.auth.refresh({ bearerToken: '<token>', })
{ "token": "eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJjdXN0b21lciIsImp0aSI6IjBlZjM1Y2I0LTY2NDgtNDE5Zi04MjkzLTgxYjU1N2ExZDQwNSIsImlzcyI6InNwcmVlIiwiYXVkIjoic3RvcmVfYXBpIiwiZXhwIjoxNzczMjQzOTM4fQ.gPHrg7pll8g-zU2xYEVR_1JyQZMxshSf7TEkvhX0QgI", "user": { "id": "cus_UkLWZg9DAJ", "email": "test@example.com", "first_name": "Wilbur", "last_name": "Romaguera", "phone": null, "accepts_email_marketing": false, "created_at": "2026-03-11T14:45:38.074Z", "updated_at": "2026-03-11T14:45:38.074Z", "addresses": [], "default_billing_address": null, "default_shipping_address": null } }
Publishable API key for store access
JWT token for authenticated customers
Bearer token
token refreshed
JWT access token
Show child attributes
Was this page helpful?