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.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJjdXN0b21lciIsImp0aSI6IjRiYjIwZmViLTY1ZTAtNDJjNS1iMjFjLTQ4YzFmZGE1NjA5YiIsImlzcyI6InNwcmVlIiwiYXVkIjoic3RvcmVfYXBpIiwiZXhwIjoxNzc0NzAxODQ5fQ._gkuJGgjt3GcsGJNWPp4_uGDgrmxtKvHypsNFmFf2Lk", "refresh_token": "w4PMNQtBJA6VtTbuwBNn3FwB", "user": { "id": "cus_UkLWZg9DAJ", "email": "test@example.com", "first_name": "Jeanett", "last_name": "Collier", "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?