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

# withAuth

```ts theme={null}
function withAuth(axiosClient: AxiosInstance, options: AuthInterceptorOptions): AxiosInstance;
```

Defined in: [hooks/axios/withAuth.ts:52](https://github.com/coinbase/cdp-sdk/blob/30d1b3dc350cd763fecf481c5bc976bd77951f3b/typescript/packages/cdp-sdk/src/auth/hooks/axios/withAuth.ts#L52)

Axios interceptor for adding the JWT to the Authorization header.

## Parameters

### axiosClient

`AxiosInstance`

The Axios client instance to add the interceptor to

### options

[`AuthInterceptorOptions`](/sdks/cdp-sdks-v2/typescript/auth/Axios/index#authinterceptoroptions)

Options for the request including API keys and debug flag

## Returns

`AxiosInstance`

The modified request configuration with the Authorization header added
