Private Readonly #contactPrivate #customerPrivate Readonly #customerPrivate Readonly #customerPrivate Readonly #customerPrivate Readonly #incomingPrivate #isPrivate Readonly #isPrivate Readonly #messagePrivate #readyPrivate Readonly #streamedPrivate Readonly #threadPrivate #websocketOptional onOptional onOptional onPrivate #createPrivate #createPrivate #finishThe tail shared by connect() and retryAuthorization() once #createConnection() has run: wait for the grant to settle (for secure sessions), wire up the Customer, and mark the instance ready. Extracted because retryAuthorization() needs to run exactly this same sequence after its own #createConnection() call — duplicating it would drift the two entry points apart (e.g. one getting the Customer wiring and the other not).
Private #initSetup Environment endpoints
Private #initWSPrivate #onPrivate #sendSend Authorization Event
Optional credentials: string | ThirdPartyCredentialsan authorization code (shorthand for the authorization_code grant), or a ThirdPartyCredentials object to use the implicit grant or supply a PKCE code verifier
Optional visitorId: VisitorIdvisitor id
Optional browserFingerprint: BrowserFingerprintBrowserFingerprint object, use getBrowserFingerprint helper function to create it
securedSession and connect)AuthorizationError
ChatSDKError - if credentials is an object whose grantType is missing or is not
'authorization_code' | 'implicit'. Rejects the promise; not delivered via onError.
Initiate a WebSocket connection
Optional credentials: string | ThirdPartyCredentialsan authorization code (shorthand for the authorization_code grant), or a ThirdPartyCredentials object to use the implicit grant or supply a PKCE code verifier
Optional botProtection: BotProtectionbot protection token (e.g. reCAPTCHA, Turnstile) sent with the initial authorization_code grant
Promise
ChatSDKError - if credentials is an object whose grantType is missing or is not
'authorization_code' | 'implicit'. Rejects the promise; not delivered via onError.
ChatSDKError | IpAddressBlockedError | CaptchaRequiredError - for secure sessions, if the authorization grant is rejected. The error is also delivered via onError; call retryAuthorization() to recover from a CaptchaRequiredError.
Generate Authorization Token from the given url
Thread Id
Authorization Service URL
the additional message content is handled internally, there is no need to use this method
Get channel availability Returns channel availability Online/Offline
ChannelAvailabilityResponse
ChatSDKError
Get channel info Returns channel info like feature toggle status, translations, file upload restrictions, theme color settings etc.
ChannelInfo
ChatSDKError
Get Thread instance by id
thread id
instance of thread based on channel settings
Get list of available threads
list of threads
Get access to a websocket connection
WebSocketClient instance
Register handler to chat event
type of chat event
event handler
function to unregister handler
Recover livechat thread data
thread id on external platform
thread livechat session data
ThreadRecoverFailedError
Recover thread data
thread id on external platform
thread session data
ThreadRecoverFailedError
Reset the ChatSdk session and clear it from customer data
Recover from a rejected authorization grant (e.g. after the SDK surfaced a CaptchaRequiredError via onError) by re-running the grant with a fresh bot-protection token.
A plain connect() retry cannot recover here: #createConnection() leaves #websocketClient non-null on failure, so connect() would just return false. This tears the failed attempt down and re-runs it with a fresh #ready deferred.
fresh bot protection token (e.g. reCAPTCHA, Turnstile) for the retried authorization_code grant
Promise
ChatSDKError | IpAddressBlockedError | CaptchaRequiredError - if the retried grant is rejected again (e.g. the captcha challenge was failed twice); safe to call again with a new token
Send the Offline Message
offline message data (name, email, message)
success
SendMessageFailedError
error.data) a response from the backend with details.Generated using TypeDoc
The current connection attempt's authorization outcome: #createSocketUrl() rejects it on a failed grant and #finishConnect() resolves it on success. connect() / retryAuthorization() / resetSession() each install a fresh one before starting a new attempt, since a settled promise can't be re-settled for the next attempt.