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

# Frontend Javascript API

You can interact with the chat window from within your own javascript functionality. We offer you some easy functions to controll it.

{% hint style="info" %}
As long as gramchat is initalized, you can access it via the global variable **chat**
{% endhint %}

### Visibility of chat window

#### gram.open()

Open the chat window

#### gram.close()

Close the chat window

#### gram.toggle()

toggle the open/close state of the chat window

#### gram.hide()

Hide the chat window and button

{% hint style="info" %}
You will not see gramchat on the website (with css`display:none`)
{% endhint %}

#### gram.show()

Show the chat window and button

### Messages

#### gram.push("your message to show")

Pushes the message (string) you pass in the function into the chat window **without sending it to the server**
