# 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',
  })
}
```


---

# 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/plugin/plugin-api.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.
