Render and unmount the Website Widget by hand, for single-page apps that show it on some routes only.
render() and unmount() control whether the widget is on the page. You need them most in single-page apps, where the widget lives outside your component tree and otherwise stays on every route once loaded.
render() puts the widget on the page. On window.Kelu it takes an onRender callback that runs once the widget is there. Open the panel from that callback.
unmount() removes it and keeps its configuration, so the next render() brings it back. Event subscriptions survive both.
The widget is in one of three states:
State
What the reader sees
Unmounted
Nothing
Mounted and closed
The launcher, or your own open button
Mounted and open
The panel
Add data-render-on-load="false" to the script tag to start unmounted: the script loads its configuration and shows nothing until render() is called.
The conversation is kept for the browser tab by default (data-persist="session"), so a reader finds it again when the widget renders on the next route. Set data-persist="none" to start empty each time.