Create the ChatBubble instance
Optional
botPrivate
configPrivate
conversationsPrivate
onPrivate
onPrivate
postPrivate
socketPrivate
Optional
userPrivate
userPrivate
Optional
userPrivate
visitorsSubscribe to changes in any of the conversations in the chat bubble.
Usage:
bubble.onConversationsUpdate.subscribe(info => console.log(`Badge count updated: ${info.badgeCount}`))
When you subscribe to the conversations update, the callback is invoked right away with the current badge count value.
Open the websocket connection to the server.
Private
connectSignal the server that the user has discarded a nudge. The given nudge will not be triggered again for this user.
Signal the server that the user has engaged with a nudge.
Optional
response: ExtendedNudgeResponseSignal the server that the user has seen the nudge.
Push a user information update to the Botsquad platform.
For any subsequent new chatbot conversation, the information provided in this API call will be
available in Bubblescript under the user.*
variable namespace.
Register a push token for the current connection.
Valid push types are web-push
, firebase
, pushwoosh
and expo
.
Send a page view event to the server.
Use this to track on which page of the website your user is currently visiting. In the backend this is used to show a realtime view of current visitors.
The URL of the current page. This parameter needs to be a valid URL, in the form of scheme://hostname/path
. For native apps, use something like app://app-package-name/current-screen
. If your native app supports Android app links or iOS Universal links, you can also send these.
The title of the current page or app screen.
Private
whenGenerated using TypeDoc
ChatBubble
The ChatBubble class is the high-level container class that allows you to render a Chat Bubble in your web page or React Native app.
Main entry point for interfacing with all functions related to the Botsquad chat bubble. Its main purposes are the following:
Getting started
Instantiate this class with a [[Config]] object; then call [[ChatBubble.connect]] to establish the connection to the server.
Example code: