Refresh token
Exchanges the HttpOnly refresh-token cookie for a new access JWT and a rotated refresh token cookie. No request body or Authorization header is required — the cookie alone authenticates the call.
POST
Spree Admin SDK
Documentation Index
Fetch the complete documentation index at: /docs/llms.txt
Use this file to discover all available pages before exploring further.
Exchanges the HttpOnly refresh-token cookie for a new access JWT and a rotated refresh token cookie. No request body or Authorization header is required — the cookie alone authenticates the call.
import { createAdminClient } from '@spree/admin-sdk'
const client = createAdminClient({
baseUrl: 'https://your-store.com',
secretKey: 'sk_xxx',
})
// Driven entirely by the HttpOnly refresh-token cookie + CSRF header (set by the SDK).
const auth = await client.auth.refresh()spree api post /auth/refresh{
"token": "eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJhZG1pbiIsImp0aSI6IjIwMzFkOWE3LTljMGMtNGNkZi05ZWU2LTE0MDI0MjIwZGFlYSIsImlzcyI6InNwcmVlIiwiYXVkIjoiYWRtaW5fYXBpIiwiZXhwIjoxNzg1MTgyNzA1fQ.qe0T7bUxlw38ohjW5xR0Xv2qflnGYPBNrib-RaTblI8",
"user": {
"id": "admin_UkLWZg9DAJ",
"email": "admin@example.com",
"first_name": "Santo",
"last_name": "Pagac",
"full_name": "Santo Pagac",
"selected_locale": null,
"created_at": "2026-07-27T20:00:05.821Z",
"updated_at": "2026-07-27T20:00:05.821Z",
"avatar_url": null,
"roles": [
{
"id": "role_UkLWZg9DAJ",
"name": "admin"
}
],
"stores": [
{
"id": "store_UkLWZg9DAJ",
"name": "Spree Test Store",
"code": "spree_1"
}
]
}
}{
"error": {
"code": "invalid_refresh_token",
"message": "Refresh token cookie missing"
}
}Was this page helpful?
import { createAdminClient } from '@spree/admin-sdk'
const client = createAdminClient({
baseUrl: 'https://your-store.com',
secretKey: 'sk_xxx',
})
// Driven entirely by the HttpOnly refresh-token cookie + CSRF header (set by the SDK).
const auth = await client.auth.refresh()spree api post /auth/refresh{
"token": "eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJhZG1pbiIsImp0aSI6IjIwMzFkOWE3LTljMGMtNGNkZi05ZWU2LTE0MDI0MjIwZGFlYSIsImlzcyI6InNwcmVlIiwiYXVkIjoiYWRtaW5fYXBpIiwiZXhwIjoxNzg1MTgyNzA1fQ.qe0T7bUxlw38ohjW5xR0Xv2qflnGYPBNrib-RaTblI8",
"user": {
"id": "admin_UkLWZg9DAJ",
"email": "admin@example.com",
"first_name": "Santo",
"last_name": "Pagac",
"full_name": "Santo Pagac",
"selected_locale": null,
"created_at": "2026-07-27T20:00:05.821Z",
"updated_at": "2026-07-27T20:00:05.821Z",
"avatar_url": null,
"roles": [
{
"id": "role_UkLWZg9DAJ",
"name": "admin"
}
],
"stores": [
{
"id": "store_UkLWZg9DAJ",
"name": "Spree Test Store",
"code": "spree_1"
}
]
}
}{
"error": {
"code": "invalid_refresh_token",
"message": "Refresh token cookie missing"
}
}