---
editLink: false
lastUpdated: false
---

[@salesforce/b2c-tooling-sdk](../../modules.md) / [auth](../index.md) / isStatefulTokenValid

# Function: isStatefulTokenValid()

> **isStatefulTokenValid**(`session`, `requiredScopes`, `expiryBufferSec`, `requiredClientId?`): `boolean`

Defined in: [packages/b2c-tooling-sdk/src/auth/stateful-store.ts:146](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/e7c16f1ae423da0aa47b3e10be88f9770b53619b/packages/b2c-tooling-sdk/src/auth/stateful-store.ts#L146)

Checks whether the stored access token is present and valid: not expired
(with a small buffer), optionally satisfies required scopes, and optionally
matches the expected client ID.
Does not perform network calls.

## Parameters

### session

[`StatefulSession`](../interfaces/StatefulSession.md)

Session from getStoredSession()

### requiredScopes

`string`[] = `[]`

If provided, token must include all of these scopes

### expiryBufferSec

`number` = `EXPIRY_BUFFER_SEC`

Seconds before exp to treat token as expired (default 60)

### requiredClientId?

`string`

If provided, session clientId must match

## Returns

`boolean`

true if token is present and valid for use
