Skip to content
TruCom Developers
JavaScript SDK
DocumentationWidget SDK
JAVASCRIPT SDK

Properties and public state

Read integration state without reading the iframe or browser session storage.

Wait, then read

State updates arrive asynchronously. getState returns a snapshot; the named convenience properties below are read-only getters.

JavaScript
await TruComWidget.ready();
const state = TruComWidget.getState();
console.log(state.isOpen, state.unreadCount);
console.log(TruComWidget.visitorId);

State reference

OptionBehavior
readyBoolean in getState(); use ready() to wait.
widgetKeyPublic installation key.
isOpen / isVisiblePanel open state / installation visibility.
visitorIdOpaque visitor ID, null until a session exists.
conversationId / conversationStateCurrent conversation ID / active, waiting or closed state; null when unavailable.
unreadCountLatest unread count delivered by the widget.
identityVerifiedWhether the current session has a signed identity.
language / themeEffective interface language / system, light or dark.
humanAvailableCurrent widget human-availability projection.
viewCurrent screen: home, messages, help, conversation, prechat, knowledge or feedback.

Authorization stays private

Bearer tokens, signing secrets, full customer profiles and message contents are not public state. Public IDs never replace session authorization. Use the signed-identity flow to recover a customer’s conversations.

TruCom DevelopersSupport that belongs in your product.

Search documentation