> ## Documentation Index
> Fetch the complete documentation index at: https://docs.openbridge.shop/llms.txt
> Use this file to discover all available pages before exploring further.

# .getToken()

> Get the raw Shopify customer access token

```javascript theme={null}
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

```javascript theme={null}
const token = openbridge.customer.getToken()

if (token) {
    await fetch('/api/sync-profile', {
        method: 'POST',
        headers: { 'X-Shopify-Customer-Token': token }
    })
}
```

<Warning>
  Treat the token as a credential. Never log it, embed it in URLs, or expose it to third parties.
</Warning>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.