openbridge.customer.getToken()
Returns the raw customer access token currently stored locally. Useful when you need to call additional Shopify APIs that require the token directly.
Returns
string | null — the access token, or null if no customer is logged in or the token has expired.
Examples
Forwarding the token to your own backend
const token = openbridge.customer.getToken()
if (token) {
await fetch('/api/sync-profile', {
method: 'POST',
headers: { 'X-Shopify-Customer-Token': token }
})
}
Treat the token as a credential. Never log it, embed it in URLs, or expose it to third parties.