Make sure to load the popup chat
script before calling these
methods.
open()
Opens the chat widget and brings it into view.Useful if you want to programmatically start a conversation (e.g., after a user clicks a
Need help?
button).
close()
Closes the chat widget without clearing its history.
This is helpful if you want to temporarily hide the chat while keeping the session intact.
closePopups()
Closes any active popup messages without affecting the main chat window.
reset()
Resets the chat session completely.
This clears the chat history, context, and state—essentially starting a new conversation from scratch.
setUserInfo()
Updates the chat widget with the current user’s information from your app.
Parameters
-
name
(optional) The user’s display name. -
email
(optional) The user’s email address. -
phone
(optional) The user’s phone number. -
info
(optional) Additional context or metadata about the user (e.g., role, plan, notes). -
stripe_accounts
(optional) An optional list of connected Stripe customer accounts. Each entry should include:id
(string, required): Stripe customer ID (e.g.,cus_xxxxx
).name
(optional): Account name.email
(optional): Account-specific email.