Embedded Chat (React)
Add a chat UI directly on a dedicated React powered page.
Overview
An "embedded chat" is a chat UI that is directly incorporated into a page instead of within a pop-up modal.
Scenarios
You may want to add an embedded chat in places where you want to encourage the user to interact with the AI chat directly. For example, an embedded chat can be useful to:
- Deflect questions in your help center site
- Provide an AI chat experience if your documentation site doesn't allow third party components, like for GitBook and ReadMe.
- Create a place for sharable chat sessions
You can incorporate the embedded chat directly on an existing page like help.domain.com
or create a dedicated one like domain.com/ask-ai
.
Quick Start
Install the component library
Define the component
Embedded Chat Props
This type represents the configuration for the Inkeep embedded chat widget.
Prop | Type | Required | Description |
---|---|---|---|
baseSettings | object | Yes | Core configuration settings. See Base Settings for details. |
aiChatSettings | object | No | AI chat configuration settings. See AI Chat Settings for details. |
isHidden | boolean | No | Whether to hide the chat interface. Defaults to false. |
shouldAutoFocusInput | boolean | No | Whether to auto focus the input. Defaults to true. |
Examples
Auto Focus Input
With AI Chat Settings
Accessing Component Methods
The aiChatSettings
config accepts a chatFunctionsRef
prop that allows you to access the chat methods.
Method | Description |
---|---|
submitMessage(message?: string) | Programmatically sends a message in chat. If message is omitted, sends the current input value. |
updateInputMessage(message: string) | Updates the text in chat input field |
clearChat() | Resets the chat to its initial state |
openForm(formSettings: FormSettings) | Displays a form overlay in chat interface |
focusInput() | Sets focus to the chat input field |
Refer to the Form Settings reference docs for more details on the available properties for the openForm
method.