Chat component

The chat component renders a complete and functional user interface for a contextual chat.

Element: <wy-chat>
Class: WyChat

Usage

First import and configure Weavy and the WyChat component.

import { Weavy, WyChat } from "@weavy/uikit-web";

const weavy = new Weavy();
weavy.url = "https://myenvironment.weavy.io";
weavy.tokenFactory = async (refresh) => "token_from_server";

Then add the <wy-chat> component to your HTML. Note that you must specify a unique identifier (uid) which automatically creates a corresponding app on your Weavy server when the component is first initialized.

<wy-chat uid="test-chat" name="Test chat"></wy-chat>

The unique identifier (uid) is something you decide what it should be. For apps it's often useful to have a uid that is related to the context where the app is displayed. For example "product-123-chat" or "customer-2-chat".

Properties

Property Type Description
uid string Unique identifier for the app.
name string Optional display name for the app (used in notifications etc.)
notifications "button-list" | "none" Set the appearance of notifications. Defaults to "button-list".
notificationsBadge "count" | "dot" | "none" Set the appearance of the notification badge. Defaults to "count".

The available features are controlled by your product license. To disable a feature you can use the following boolean attributes/properties.

Property Description
noAttachments Disable the possibility to upload local attachments.
noCloudFiles Disable the cloud files integration.
noMeetings Disable the video meetings integration.
noMentions Disable the possibility to mention other people.
noPolls Disable possibility to create a poll.
noPreviews Disable previews of files.
noReactions Disable the possibility to add emoji reactions.

Example: Render a chat component with the reactions feature disabled.

<wy-chat uid="test-chat" noReactions></wy-chat>