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

# generateJwt

```ts theme={null}
function generateJwt(options: JwtOptions): Promise<string>;
```

Defined in: [utils/jwt.ts:109](https://github.com/coinbase/cdp-sdk/blob/59b6f4f714b6e359fb2390fa1df724c8c5419568/typescript/packages/cdp-sdk/src/auth/utils/jwt.ts#L109)

Generates a JWT (also known as a Bearer token) for authenticating with Coinbase's REST APIs.
Supports both EC (ES256) and Ed25519 (EdDSA) keys. Also supports JWTs meant for
websocket connections by allowing requestMethod, requestHost, and requestPath to all be
null, in which case the 'uris' claim is omitted from the JWT.

## Parameters

### options

[`JwtOptions`](/sdks/cdp-sdks-v2/typescript/auth/JWT/index#jwtoptions)

The configuration options for generating the JWT

## Returns

`Promise`\<`string`>

The generated JWT (Bearer token) string

## Throws

If required parameters are missing, invalid, or if JWT signing fails
