Static ReadonlyATTR_Access type for opening the conversation.
Defaults to ConversationAccessType.NORMAL if not set.
Static ReadonlyATTR_ID of the conversation to open in the component
Static ReadonlySLOT_Name of the slot used to provide custom content displayed when no conversation is open.
If the slot has no content, Unblu displays the standard loader instead.
The access type for opening the conversation. Defaults to ConversationAccessType.NORMAL if not set.
Note: When setting both conversationId and accessType, changes are batched and applied together in a single update
to avoid unnecessary reconnections. For explicit control, use openConversation instead.
The access type for the conversation
UnbluConversationElement.ATTR_ACCESS_TYPE to set this as an attribute
The Conversation API object for the currently open conversation.
Returns null if no conversation is open or the agent JS API isn't initialized yet.
The returned instance is destroyed and replaced when the open conversation or the access type changes.
The ID of the conversation to display.
This can be set before Unblu is initialized. The conversation is then opened as soon as Unblu is initialized.
If the conversation doesn't exist, or the user doesn't have permission to access it, a dialog is displayed with the appropriate error message.
In such cases, the conversation ID is reset to null.
Note: When setting both conversationId and accessType, changes are batched and applied together in a single update
to avoid unnecessary reconnections. For explicit control, use openConversation instead.
The id of the conversation to open
UnbluConversationElement.ATTR_CONVERSATION_ID to set this as an attribute
Registers for the UnbluConversationElement.CONVERSATION_CHANGED event
Optionaloptions: boolean | AddEventListenerOptionsRegisters for the UnbluConversationElement.ACCESS_TYPE_CHANGED event
Optionaloptions: boolean | AddEventListenerOptionsOpens a conversation with the given ID and access type.
This is the recommended way to programmatically change the conversation and access type together, as it applies both values in a single update without batching delay.
The method can be called before the Agent Embedded JS API is initialized. The conversation is then opened as soon as Unblu is initialized.
If the conversation doesn't exist, or the user doesn't have permission to access it, a dialog is displayed with the appropriate error message.
In such cases, the conversation ID is reset to null.
The previously opened conversation will be closed and disconnected.
The ID of the conversation to open, or null to close the current conversation without opening another conversation
The access type for the conversation. Defaults to ConversationAccessType.NORMAL
The Conversation API object for the conversation being opened,
or null if conversationId is null or the agent JS API isn't initialized yet
Removes a listener registration for the UnbluConversationElement.CONVERSATION_CHANGED event
Removes a listener registration for the UnbluConversationElement.ACCESS_TYPE_CHANGED event
Static ReadonlyACCESS_Event emitted every time the conversation access type changes.
Static ReadonlyCONVERSATION_Event emitted every time the currently open conversation changes.
This is a custom element which can be used to integrate a single conversation into a webpage at a specific location.
To use the custom element, place a tag named "unblu-conversation" somewhere in the web page's
body.The size and positioning of the element depend entirely on the styles applied to it by the website that it's embedded in. The styling within the web component, on the other hand, aren't affected by the website's styles, because it uses a shadow root for its content. Unblu provides numerous configuration properties that let you customize the web component's appearance to suit your organization's requirements.
The example above only adds the conversation component to the
DOMwithout initializing anything. To initialize and display content, you must create the UnbluAgentEmbeddedApi. Until then, the element doesn't display any content other than content the webpage itself adds inside the tag, which renders as regularDOMchildren.Once the Agent Embedded JS API is initialized and until a conversation is opened, the element displays the content provided via the
no-conversationslot, or the standard loader if the slot has no content.The Unblu UI inside the custom element always fills the whole content of the element irrespective of the size it's given.
Note: It is possible to display as many UnbluEmbeddedAppElement and UnbluConversationElement as one likes with the restriction that one conversation can only be displayed in one of them.
Attributes
conversation-id: ID of the conversation to display. See UnbluConversationElement.conversationId.access-type: Access type for the conversation. One ofNORMAL(default) orGHOST. See UnbluConversationElement.accessType.Custom content while no conversation is open
To customize what's displayed while no conversation is open, provide content via the
no-conversationslot. If the slot has no content, Unblu displays the standard loader instead.Programmatic control
To change the conversation and access type together, use the openConversation method. This applies both values atomically without batching delay:
The conversation property gives access to the Conversation API object of the currently open conversation.
When setting both
conversation-idandaccess-typeattributes (or properties) separately, changes are automatically batched within the same microtask to avoid unnecessary reconnections.Events
conversationChangedfires when the displayed conversation changes. See UnbluConversationElement.CONVERSATION_CHANGED.accessTypeChangedfires when the access type changes. See UnbluConversationElement.ACCESS_TYPE_CHANGED.See
MDN Custom Element
No Inherit Doc