# Create Access Token

Create a JWT authentication token for use in the onboarding client components and other API services.

## **Parameters**

<table><thead><tr><th width="388">Name</th><th width="104">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>apiKey</code><mark style="color:red;"><code>*</code></mark></td><td>string</td><td>Your API Key</td></tr><tr><td><code>options</code></td><td>object</td><td>API and Fetch Options</td></tr></tbody></table>

### Parameter Options

<table><thead><tr><th width="300">Name</th><th width="144">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>allowUnsafeClientApiCall</code></td><td>boolean</td><td>Allow service to run in client</td></tr></tbody></table>

## SDK Configuration

<table><thead><tr><th width="265">Name</th><th width="209">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>environment</code><mark style="color:red;"><code>*</code></mark></td><td>QuadrataEnvironment</td><td>Access token<br>See <a href="create-access-token">createAccessToken</a></td></tr></tbody></table>

{% hint style="info" %}
See [API Authentication](https://docs.quadrata.com/integration/how-to-integrate/onboard-users/individual-passport-onboarding/2.-api-authentication) for more information about the underlying API endpoint.
{% endhint %}

## Example

```typescript
import type { API } from '@quadrata/sdk/types';
import { createAccessToken, QuadrataEnvironment } from '@quadrata/sdk/api';

type ResponseType = API.Services.CreateAccessToken.Response;

const response: ResponseType = await createAccessToken(
    {
        apiKey: process.env.QUADRATA_API_KEY,
        options: {
            // not recommended as it exposes your API key
            allowUnsafeClientApiCall: true,
            
            // optional fetch options
            cache: 'no-cache'
        }
    },
    { environment: QuadrataEnvironment.PRODUCTION }
);

const { data: { accessToken } } = response;
```
