> ## 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.

# JWT

## Interfaces

### JwtOptions

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

JwtOptions contains configuration for JWT generation.

This interface holds all necessary parameters for generating a JWT token
for authenticating with Coinbase's REST APIs. It supports both EC (ES256)
and Ed25519 (EdDSA) keys.

#### Properties

##### apiKeyId

```ts theme={null}
apiKeyId: string;
```

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

The API key ID

Examples:
'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
'organizations/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/apiKeys/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'

##### apiKeySecret

```ts theme={null}
apiKeySecret: string;
```

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

The API key secret

Examples:
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx==' (Edwards key (Ed25519))
'-----BEGIN EC PRIVATE KEY-----\n...\n...\n...==\n-----END EC PRIVATE KEY-----\n' (EC key (ES256))

##### requestMethod?

```ts theme={null}
optional requestMethod: string | null;
```

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

The HTTP method for the request (e.g. 'GET', 'POST'), or null for JWTs intended for websocket connections

##### requestHost?

```ts theme={null}
optional requestHost: string | null;
```

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

The host for the request (e.g. 'api.cdp.coinbase.com'), or null for JWTs intended for websocket connections

##### requestPath?

```ts theme={null}
optional requestPath: string | null;
```

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

The path for the request (e.g. '/platform/v1/wallets'), or null for JWTs intended for websocket connections

##### expiresIn?

```ts theme={null}
optional expiresIn: number;
```

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

Optional expiration time in seconds (defaults to 120)

##### audience?

```ts theme={null}
optional audience: string[];
```

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

Optional audience claim for the JWT

***

### WalletJwtOptions

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

WalletJwtOptions contains configuration for Wallet Auth JWT generation.

This interface holds all necessary parameters for generating a Wallet Auth JWT
for authenticating with endpoints that require wallet authentication.

#### Properties

##### walletSecret

```ts theme={null}
walletSecret: string;
```

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

* The Wallet Secret

##### requestMethod

```ts theme={null}
requestMethod: string;
```

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

* The HTTP method for the request (e.g. 'GET', 'POST')

##### requestHost

```ts theme={null}
requestHost: string;
```

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

* The host for the request (e.g. 'api.cdp.coinbase.com')

##### requestPath

```ts theme={null}
requestPath: string;
```

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

* The path for the request (e.g. '/platform/v1/wallets/\{wallet\_id}/addresses')

##### requestData

```ts theme={null}
requestData: Record<string, any>;
```

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

* The request data for the request (e.g. `{ "wallet_id": "1234567890" }`)

## Functions

* [generateJwt](/sdks/cdp-sdks-v2/typescript/auth/JWT/generateJwt)
* [generateWalletJwt](/sdks/cdp-sdks-v2/typescript/auth/JWT/generateWalletJwt)
