# JS SDK

{% embed url="<https://www.npmjs.com/package/@thxnetwork/sdk>" %}
Download @thxnetwork/sdk on NPM
{% endembed %}

The SDK allows for an easy implementation of THX API in both browsers and JavaScript backends. Make sure to obtain your API credentials in your campaign dashboard.

<figure><img src="https://1499671166-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fda0CPvFjFKQsHDL5o9xa%2Fuploads%2F8LjqcEv4eQBkhXVRgozU%2FScreenshot%202024-08-01%20at%2015.15.38.png?alt=media&#x26;token=0bc5a94d-3058-4188-92fd-524f258fe1a3" alt=""><figcaption><p>Example of API keys under Account -> Developer -> API</p></figcaption></figure>

### THXAPIClient

```javascript
const { THXAPIClient } = require('@thxnetwork/sdk');

const thx = new THXAPIClient({
    apiKey: '',
});
```

#### Create Identity

Identities are unique codes that you can use to allocate event data to. After connecting the Identity to a THX account your users will be able to complete custom quests for this event data.

```javascript
const identity = await thx.identity.create()
// a6021617-9aab-4194-b2af-a4dd0cc96f84
```

{% content-ref url="js-sdk/identity" %}
[identity](https://docs.thx.network/developers/js-sdk/identity)
{% endcontent-ref %}

{% content-ref url="js-sdk/events" %}
[events](https://docs.thx.network/developers/js-sdk/events)
{% endcontent-ref %}
