Exchanges a refresh token for a new access JWT and rotated refresh token. No Authorization header needed.
JavaScript
import { createClient } from '@spree/sdk' const client = createClient({ baseUrl: 'https://your-store.com', publishableKey: '<api-key>', }) const auth = await client.auth.refresh({ refresh_token: 'rt_xxx', })
{ "token": "eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJjdXN0b21lciIsImp0aSI6IjY0MWQ5Y2NmLTNhM2EtNDk2OS1hNWUyLWUwNWViZjdmYWIxNyIsImlzcyI6InNwcmVlIiwiYXVkIjoic3RvcmVfYXBpIiwiZXhwIjoxNzc2MTYxODIzfQ.6CIayRaSgbOgiwJyuweu92lgkwboaEufAQDHjrWCR5Y", "refresh_token": "NPstvWaaAHLokJkeKyfY4TzG", "user": { "id": "cus_UkLWZg9DAJ", "email": "test@example.com", "first_name": "Shiloh", "last_name": "Robel", "phone": null, "accepts_email_marketing": false, "available_store_credit_total": "0", "display_available_store_credit_total": "$0.00", "addresses": [], "default_billing_address": null, "default_shipping_address": null } }
Publishable API key for store access
Refresh token from login response
token refreshed
JWT access token
Refresh token for obtaining new access tokens
Show child attributes
Was this page helpful?
Contact support