# 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="/pages/9dpQxq4Rgn4SBf9Ebnp1">createAccessToken</a></td></tr></tbody></table>

{% hint style="info" %}
See [API Authentication](/integration/how-to-integrate/onboard-users/individual-passport-onboarding/2.-api-authentication.md) 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;
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.quadrata.com/integration/how-to-integrate/quadrata-sdk/advanced/api-libraries/api-service-libraries/create-access-token.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
