Developer docs
Embed the widget, control it from JavaScript, and receive responses by webhook.
Install
Paste before </body>:
<script>window.GrowwChatId = "YOUR_FORM_ID";</script>
<script src="/embed.js" async></script>JavaScript API
| growwchat.ready(fn) | Run fn once the widget has loaded. |
| growwchat.config(obj) | Set options before load (e.g. {autoLoad:false}). |
| growwchat.open() / close() / toggle() | Control the chat panel. |
| growwchat.load() / unload() | Mount or remove the widget. |
| growwchat.clear() | Reset the conversation and cookies for this visitor. |
| growwchat.set(key, value) | Pass a custom field; use {{key}} in messages. |
| growwchat.message(text) | Show a bot message to the visitor. |
| growwchat.is(state) | Check state: "open", "loaded", "completed". |
| growwchat.on(event, fn) | Events: ready, open, close, complete, answer. |
growwchat.ready(() => {
growwchat.set('plan', 'pro');
growwchat.on('complete', () => gtag('event', 'lead'));
});Cookies
growwchat_page_load, growwchat_closed, growwchat_completed — 30 days. Used to remember the visitor state.
Webhooks
POST JSON on each response. 2xx = ok; 5xx/timeouts retried up to 3 times.
{ "formId": "...", "responseId": "...", "status": "completed",
"answers": [{ "questionId": "q1", "key": "email", "value": "a@b.co" }] }