Static ReadonlyATTR_ID of the conversation currently open in the embedded app. If set, the conversation is opened in the embedded app.
Opens the conversation with the given conversation ID.
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.
The id of the conversation to open
UnbluEmbeddedAppElement.ATTR_CONVERSATION_ID to set this as an attribute
Registers for the UnbluEmbeddedAppElement.OPEN_CONVERSATION_CHANGED event
Optionaloptions: boolean | AddEventListenerOptionsRegisters for the UnbluEmbeddedAppElement.MESSAGE_INPUT_AVAILABILITY_CHANGED event
Optionaloptions: boolean | AddEventListenerOptionsCopies the given content (text and/or files) into the message input of the conversation currently open in the embedded app.
The content is inserted into the current state of the message input (by default appended) so the agent can review and edit it before sending.
Files are added to the pending files of the message input; the same validation as for manually selected files applies.
If options.internal is set, the message input is also switched to the internal or public messaging mode.
After copying, the message input receives the focus.
If the message input isn't currently displayed, for example because a call is ongoing, the chat UI is opened automatically so the agent sees the copied content.
Use getMessageInputAvailability to check upfront what content can be copied.
The content to copy and how it is inserted
Optionaloptions: CopyToMessageInputOptionsOptions controlling how the content is copied, for example the messaging mode
Resolves once the content has been copied into the message input
UnbluApiError with type UnbluErrorType.ILLEGAL_STATE when the element isn't connected or the Agent Embedded JS API isn't initialized.
UnbluApiError with type UnbluErrorType.INVALID_FUNCTION_ARGUMENTS if the given content or options are invalid.
UnbluApiError if the requested content can't be copied based on the current availability, for example no conversation is open in the embedded app, the agent lacks the permission for the requested messaging mode, or the content contains files while the file upload isn't available.
Returns what content can currently be copied into the message input of the conversation open in the embedded app, based on the conversation permissions of the agent.
All fields are false if no conversation is open in the embedded app or the Agent Embedded JS API isn't initialized.
To get notified when the availability changes, listen to the MESSAGE_INPUT_AVAILABILITY_CHANGED event.
The availability of the message input for content copied via copyToMessageInput
Registers an open conversation interceptor that's triggered whenever a conversation should be opened from the embedded app's inbox view.
The interceptor, which should resolve to an OpenConversationInterceptorResult with action OPEN if the embedded app UI should open the conversation or DISCARD if the embedded app will do nothing and the integrating page must handle the request.
see #unregisterOpenConversationInterceptor to unregister the interceptor
Removes a listener registration for the UnbluEmbeddedAppElement.OPEN_CONVERSATION_CHANGED event
Removes a listener registration for the UnbluEmbeddedAppElement.MESSAGE_INPUT_AVAILABILITY_CHANGED event
Unregisters an open conversation interceptor used previously
The interceptor to unregister
see #registerOpenConversationInterceptor to register a new interceptor
Static ReadonlyMESSAGE_Event emitted every time the availability of the message input changes, see getMessageInputAvailability.
Static ReadonlyOPEN_Event emitted every time the currently open conversation changes in the embedded app.
This is a custom element which can be used to integrate the agent's embedded app (inbox and conversations) into a webpage at a specific location.
To use the custom element, place a tag named "unblu-embedded-app" somewhere in the web page's
body. By default, the element shows the agent's inbox. If aconversation-idattribute is set on the element, it shows that conversation instead.The size and positioning 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 organizations requirements.
The example above only adds the embedded app component to the
DOMwithout initializing anything. To initialize and display content, you must create the UnbluAgentEmbeddedApi.The Unblu UI inside the custom element always fills the whole content of the element irrespective of the size it's given.
Note: You can display any number of UnbluEmbeddedAppElement and UnbluConversationElement components on the same page, with the restriction that a conversation can only be displayed in one of them at a time, regardless of the component type. If a conversation is already displayed in one component, opening it in another component fails: that component shows a message dialog and reverts to its previous view.
Attributes
conversation-id: ID of the conversation to open in the embedded app. See UnbluEmbeddedAppElement.conversationId.Events
openConversationChanged: fires when the open conversation changes. See UnbluEmbeddedAppElement.OPEN_CONVERSATION_CHANGED.messageInputAvailabilityChanged: fires when the availability of the message input changes. See UnbluEmbeddedAppElement.MESSAGE_INPUT_AVAILABILITY_CHANGED.Interceptors
You can register an interceptor to control what happens when a conversation is opened from the embedded app's inbox view. This is useful when you want to open the conversation in a separate
<unblu-conversation>component rather than within the embedded app itself.See
MDN Custom Element
No Inherit Doc