# Quick Start

> JS SDK for relation IM: A simple API for building IM services.

### `Quick start`

Download using NPM

```javascript
npm install --save @relationlabs/im
npm install --save @relationlabs/auth
```

then

use `authByMetamask` to activate `Metamask` signing and acquire an `addressAuthToken`

```javascript
import { authByMetamask } from "@relationlabs/auth";

const { error, token: addressAuthToken } = await authByMetamask()
```

then

use `getRelationToken` to acquire `unifiedAuthToken`. The `APIKEY` should be acquired from the Admin.

```javascript
import RelationIM from "@relationlabs/im";
import { authByMetamask } from "@relationlabs/auth";

const { error, token: addressAuthToken } = await authByMetamask()

const APIKEY = '581c6c4fa0b54912b00088aa563342a4'

if (!error && addressAuthToken) {
    const { error, token: unifiedAuthToken } = await RelationIM.getRelationToken(addressAuthToken, APIKEY)
    if (!error && unifiedAuthToken) {

    }
}
```

then

instantiate an `im` instance

```javascript
const myIm = RelationIM.init({token: unifiedAuthToken, apiKey: APIKEY, connect: true})
```


---

# 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://relationlabs.gitbook.io/relation-one-api/js-sdk/im-js-sdk/quick-start.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.
