Gapsoo.open()
Open the widget.
Once the widget is installed, the global object below is available on the page. Calls made before the widget is ready are queued.
window.Gapsoo.setUser({ name: 'Sara', email: 'sara@example.com' });
window.addEventListener('gapsoo:message:received', (e) => console.log(e.detail));Open the widget.
Close the widget.
Open or close the widget.
Set the visitor's details. Filled fields are overwritten only with forceUpdate.
| Field | Type | Required |
|---|---|---|
email | string (email) | No |
name | string | No |
about | string | No |
phone | string | No |
avatar | string (uri) | No |
tags | string[] | No |
metadata | object[] | No |
forceUpdate | boolean | No |
Read the visitor's details. The answer comes back through a callback.
Change the widget's look on this page only.
| Field | Type | Required |
|---|---|---|
iconUrl | string (uri) | No |
cssUrl | string (uri) | No |
soundUrl | string (uri) | No |
marginRight | integer | No |
marginLeft | integer | No |
marginBottom | integer | No |
hasIcon | boolean | No |
hasSound | boolean | No |
counter | boolean | No |
filterWords | string[] | No |
The current visitor id.
Continue the same conversation on another device with the visitor id. The answer comes back through a callback.
| Field | Type | Required |
|---|---|---|
— | string | Yes |
Forget the visitor id in this browser.
Send a message as the visitor.
| Field | Type | Required |
|---|---|---|
text | string | Yes |
Remove the widget from the page.
gapsoo:ready — The widget is ready.gapsoo:message:sent — The visitor sent a message.gapsoo:message:received — A message from an operator arrived.An operator or the API can add buttons with the code below in a message. At most 10 buttons per message.
[button title="..." action="open_url|show_message|assign|js_event|send_webhook" data="..." message_after_click="..."] (max 10)