API Documentation
Learn how to integrate and customize the FAQ Chat widget in your website.
See It In Action
This website has a live integration of the FAQ Chat widget. Try clicking the chat button in the bottom right corner to see it in action. You can also ask it questions about the FAQ Chat API!
Basic Installation
Add the following script tag to your website to install FAQ Chat:
Replace YOUR_API_KEY
with your actual API key from the Dashboard.
JavaScript API
Once installed, you can interact with the FAQ Chat widget using the global window.FAQChat
object.
Open the Chat Widget
This method programmatically opens the chat widget. You can open it in fullscreen mode by passing true as a parameter.
Parameters:
- fullScreen: Open the chat widget in fullscreen modal view with a backdrop overlay. (boolean, optional, defaults to false)
Close the Chat Widget
This method programmatically closes the chat widget.
Customize Primary Color
This method changes the primary color of the chat widget. Accepts any valid CSS color value.
Display Welcome Message
This method displays a custom message in the tooltip above the chat button. You can customize the welcome message to greet users or provide information about your support.
Parameters:
- message: The message to display. (string)
Show/Hide Tooltip
These methods allow you to programmatically show or hide the chat tooltip. The tooltip contains your welcome message and call-to-action buttons.
Show/Hide Notification Indicator
These methods control the red notification dot on the chat button. You can use this to draw attention to the chat when you have important messages or updates for your users.
Example Usage
Here's a complete example showing how to use the FAQ Chat JavaScript API: