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

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

# Function: isJwtTokenValid()

> **isJwtTokenValid**(`token`, `requiredScopes`, `expiryBufferSec`): `boolean`

Defined in: [packages/b2c-tooling-sdk/src/auth/jwt-utils.ts:50](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/d7ff38c7ca2b1411cd718b9554500c9416f00266/packages/b2c-tooling-sdk/src/auth/jwt-utils.ts#L50)

Returns `true` if the token is non-empty, decodes successfully, has not
expired (with a small buffer), and includes all required scopes.

## Parameters

### token

`string`

The JWT access token

### requiredScopes

`string`[] = `[]`

Scopes that must all be present in the token (default: none)

### expiryBufferSec

`number` = `DEFAULT_EXPIRY_BUFFER_SEC`

Treat token as expired this many seconds before its real `exp`

## Returns

`boolean`
