API Overview
Web chat is meant to be completely extendable to allow you to concentrate on what makes your use case unique, and let IBM watsonx Assistant worry about universal chat needs.
Overview
Web chat renders directly onto your website and not into an iFrame. This gives you and the web chat API much more power to deeply integrate with your website and code base.
Warning: since web chat is embedded directly on your page this means it can be susceptible to the CSS of your website effecting its content. Web chat has an aggressive CSS reset, but can experience problems if your website is making heavy use of !important in its styling.
Configuration
When your page initializes the web chat widget, it passes in a configuration object that sets various immutable options. By editing the configuration object, you can control the appearance and behavior of Web Chat before your customers even see it. Configuration options enable you to specify the location of the web chat widget on your page, choose whether to use the IBM-provided launcher or your own, and more.
Learn more about configuration
Instance methods
Each instance of web chat provides a collection of runtime methods your website can call any time after the instance is available on your website. These methods can be applied before or after the web chat is rendered on the screen. With these methods, you can open or close the web chat widget from a custom control, send messages to your assistant from your own functions, theme the web chat, dynamically update web chat text strings and more.
Learn more about instance methods
Events
Throughout its life cycle, web chat fires a variety of events your code can subscribe to. Using event handler callbacks, you can manipulate the contents of messages before they are sent or after they are received; you can change how your website is rendered when the web chat opens or closes; and you can even render your own custom response types inside the web chat widget.
Theming and custom content
There are multiple ways you can customize how the web chat looks on your website. You can pick a base theme and customize individual colors and fonts. You can embed your own custom HTML/CSS/Javascript content as part of user_defined
responses from your assistant. And you can write custom content to various areas of the web chat to enable additional content; for example, you might add cards to your home screen to integrate with your sales process, or you might add areas inside the conversation to emphasize the personality of your brand.
Learn more about theming and custom content
Service Desks
Many users of web chat need to be able to fall back to a human if their assistant cannot help with a given topic. Web chat includes support for Salesforce and ZenDesk out of the box. If you are using a different service desk; web chat allows you to extend the web chat with support for various service desks.
Visit GitHub to learn more about extending with a custom service desk