> For the complete documentation index, see [llms.txt](https://relationlabs.gitbook.io/relation-one-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://relationlabs.gitbook.io/relation-one-api/js-sdk/plugin/plugin-api.md).

# Quick Start

Relation ONE will inject a global API `window.relationOne` to a website a user is visiting. This API allows the website to wake up the plugin and open a chat window with a friend.

***

## Version requirement for the plugin

`Please use it on v0.7.8 and later version`

***

## Injection detection for the plugin

```javascript
if (typeof window.relationOne !== 'undefined') {
  console.log('Relation ONE is installed!');
}
```

***

## Waking up the chat window of the plugin:

| Parameter  | Type   | Note                  |
| ---------- | ------ | --------------------- |
| relationId | string | A friend's relationId |
| userName   | string | A friend's user name  |

Open a chat window with a specified user:

```javascript
if (window.relationOne && window.relationOne.chat) {
  window.relationOne.chat({
    relationId: 'xxx-xxx-xxx',
    userName: 'xxxx',
  })
}
```
