# Frontend Javascript API

{% 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**
