Chat ComponentsReact

Embedded Chat

Copy page

Integrate Inkeep's embedded chat component directly into your React application for inline agent conversations.

The InkeepEmbeddedChat component provides a fully embedded chat interface that you can integrate directly into your React application's layout. Unlike modal or sidebar implementations, the embedded chat becomes part of your page structure, perfect for dedicated support pages, dashboards, or help centers.

Installation

Quick Start

Props

Prop

Type

Whether to show the chat.

Type

boolean | undefined

Default

false

Whether to autofocus the chat input on load.

Type

boolean | undefined

Default

true

Type

"no-shadow" | "container-with-shadow" | undefined

Type

React.ComponentType<InkeepEmbeddedChatProps> | undefined

Configuration for the base settings.

Type

InkeepBaseSettings | undefined

Configuration for the chat.

Type

(InkeepAIChatSettings & { shouldAutoFocusInput?: boolean; }) | undefined

Base Settings

Prop

Type

The display name of your organization that will be shown in various UI elements. For example, this may appear in chat messages or headers.

Type

string | undefined

The primary brand color used throughout the widget UI. This color will be used to generate a cohesive color scheme. Should be provided as a valid CSS color value (hex, rgb, etc).

Type

string

Settings to control the color mode (light/dark) behavior. Can be used to sync with your application's theme or set a forced color mode.

Type

ColorModeConfig | undefined

Theme customization settings for the widget. Allows customizing colors, typography, component styles, and more.

Type

UserTheme | undefined

Custom icon overrides for the default icon set. Allows replacing any of the built-in icons with your own components.

Type

CustomIconMap | undefined

Properties to identify and provide context about the current user. Used for personalization and analytics tracking.

Type

UserProperties | undefined

Authentication token for the current user. Used for authenticated API requests if required.

Type

string | undefined

Additional properties to be sent with analytics events. These properties will be merged with the event properties.

Type

Record<string, unknown> | undefined

Handler for analytics events from the widget.

Type

((event: InkeepCallbackEvent) => Promise<void>) | undefined

Parameters

event -

The analytics event object

Returns

Promise that resolves when the event is logged

Handler for feedback events from the widget.

Type

((feedback: InkeepFeedback & { properties?: Record<string, unknown>; }) => Promise<InkeepFeedback>) | undefined

Parameters

feedback -

The feedback object

Returns

The feedback object

Whether to bypass the captcha challenge. Only enable this flag if using a server side API type api key, otherwise the api requests will fail without the challenge solution.

Type

boolean | undefined

Default

false

Function to transform source data before display.

Type

TransformSource | undefined

Parameters

source -

The original source data

type -

The type of source data

opts -

The options for the transform source

Returns

The transformed source data

Reference to the shadow DOM host element if using custom Shadow DOM. Required when embedding the widget within a Shadow DOM.

Type

HTMLElement | null | undefined

Reference to the root element where the widget is mounted. Used for positioning and event handling.

Type

HTMLElement | null | undefined

Custom tags for widget identification. Used in analytics to segment and filter widget instances. Array of string identifiers.

Type

string[] | undefined

Instance of the Prism syntax highlighting library. Required for code block syntax highlighting functionality.

Type

any

Query parameters to automatically append to URLs in the widget. Useful for tracking or maintaining context in navigation. Object mapping parameter names to values.

Type

UrlQueryParam | undefined

Base-level filters to apply to all search and chat operations. These are typically organization or user-level filters.

Type

SearchAndChatFilters | undefined

ColorModeConfig

Prop

Type

Configuration for syncing the widget's color mode with an external element.

This allows the widget to automatically match its color mode (light/dark) with your application's theme. The widget will observe changes to specified attributes on a target element and update its appearance accordingly.

Type

SyncColorMode | undefined

List of all available colorMode names

Type

string[] | undefined

Forced colorMode name for the current page

Type

string | undefined

Whether to switch between dark and light colorModes based on prefers-color-scheme

Type

boolean | undefined

Disable all CSS transitions when switching colorModes

Type

boolean | undefined

Whether to indicate to browsers which color scheme is used (dark or light) for built-in UI like inputs and buttons

Type

boolean | undefined

Key used to store colorMode setting in localStorage

Type

string | undefined

Default colorMode name (for v0.0.12 and lower the default was light). If enableSystem is false, the default colorMode is light

Type

string | undefined

HTML attribute modified based on the active colorMode. Accepts class and data-* (meaning any data attribute, data-mode, data-color, etc.)

Type

"class" | (string & {}) | undefined

Mapping of colorMode name to HTML attribute value. Object where key is the colorMode name and value is the attribute value

Type

ValueObject | undefined

Nonce string to pass to the inline script for CSP headers

Type

string | undefined

UserProperties

Prop

Type

The user ID.

Type

string | undefined

The user email.

Type

string | undefined

The user name.

Type

string | undefined

The user cohorts.

Type

string[] | undefined

AI Chat Settings

Prop

Type

Headers for requests

Type

Record<string, string> | undefined

API key for requests

Type

string | undefined

Agent URL for chatstream API.

Type

string | undefined

Context to be passed to the chatstream API.

Type

Record<string, unknown> | undefined

The placeholder text to display in the chat input field when empty. Use this to provide guidance on what kind of questions users can ask.

Type

string | undefined

A welcome message shown at the start of a new chat session. Supports markdown formatting for rich text styling. Use this to introduce the AI assistant's capabilities and set expectations.

Type

string | undefined

The name of the product/service/topic that the chat assistant specializes in. This helps contextualize the chat experience for users. If not provided, defaults to the organization name from base settings.

Type

string | undefined

The display name for the AI assistant in the chat interface. Choose a name that reflects the assistant's role and your brand.

Type

string | undefined

URL to the AI assistant's avatar image. Should be a square image, recommended size 40x40px. Supports common image formats (PNG, JPG, SVG).

You can pass a string or an object to configure for different color modes.

Type

string | { light: string; dark: string; } | undefined

URL to the user's avatar image in the chat interface. Should be a square image, recommended size 40x40px. Falls back to a default user icon if not provided.

Type

string | undefined

Controls whether links in chat messages open in new browser tabs. Enable this to help users maintain their chat context when following links.

Type

boolean | undefined

Default

true

Custom heading text for the example questions section. Use this to better describe your suggested queries.

Type

string | undefined

A list of pre-written questions users can click to quickly start a conversation. These should reflect common use cases and help users understand the AI assistant's capabilities.

Type

string[] | { value: string; label: string; }[] | undefined

Whether to visually emphasize the first example question. Use this to draw attention to the most important or common query.

Type

boolean | undefined

Enables the ability to share chat conversations via URL. Useful for allowing users to share helpful conversations with teammates.

Type

boolean | undefined

The base URL path used when generating shareable chat links. Should match your application's routing structure.

Type

string | undefined

Controls the visibility of the copy chat button. Allows users to copy the entire chat transcript to their clipboard.

Type

boolean | undefined

Unique identifier for loading a specific conversation. Use this to restore a previous conversation state.

Type

string | undefined

When enabled, prevents users from sending new messages. Useful for displaying archived or shared chat sessions.

Type

boolean | undefined

Default

false

Whether to make conversations public by default.

Type

"public" | "private" | undefined

Default

undefined (private)

Configuration for the chat's disclaimer message. Use this to display important notices about AI limitations or data usage.

Type

AIChatDisclaimerSettings | undefined

Callback function triggered whenever the user modifies their input message.

Type

((message: string) => void) | undefined

Parameters

message -

The current content of the input field

React ref for accessing the chat component's methods. Enables programmatic control of chat functions from parent components.

Type

Ref<AIChatFunctions> | undefined

Array of actions available in the "Get Help" menu. Use this to provide alternative support options like contact forms or documentation links.

Type

GetHelpOption[] | undefined

Array of actions available rendered after each message.

Type

CustomMessageAction[] | undefined

Custom heading text for the workflows section. Use this to describe available automated processes or guided flows.

Type

string | undefined

Custom labels for the chat interface's action buttons. Use this for internationalization or to better match your application's terminology.

Type

AIChatToolbarButtonLabels | undefined

Filters to apply to the chat results.

Type

SearchAndChatFilters | undefined

Components to be rendered in the chat interface.

Type

ComponentsConfig<any> | undefined

Type

ComponentsConfig<any> | undefined

AIChatFunctions

Prop

Type

Programmatically sends a message in the chat.

Type

(message?: string) => void

Parameters

message -

Optional message text. If omitted, sends the current input value.

Programmatically updates the text in the chat input field.

Type

(message: string) => void

Parameters

message -

The new message text to set

Resets the chat to its initial state. Removes all messages and resets any active workflows.

Type

() => void

Displays a form overlay in the chat interface.

Type

(formSettings: AIChatFormSettings, getHelpOption?: GetHelpOption) => void

Parameters

formSettings -

Configuration object defining the form's fields and behavior

getHelpOption -

Optional getHelpOption that triggered the form (for analytics)

Programmatically sets focus to the chat input field. Useful after programmatic updates or when showing the chat interface.

Type

() => void

AIChatDisclaimerSettings

Prop

Type

Controls whether the disclaimer message is shown. Enable this when you need to display important notices or legal disclaimers.

Type

boolean | undefined

Default

false

The main text content of the disclaimer message. Should clearly communicate important information about AI usage or limitations.

Type

string | undefined

Additional information shown when hovering over the disclaimer. Use this to provide more detailed explanations or context.

Type

string | undefined

GetHelpOption

Prop

Type

Type

InkeepCustomIcon | undefined

Type

string

Type

boolean | undefined

Type

ChatAction

CustomMessageAction

Prop

Type

Type

string | undefined

Type

InkeepCustomIcon | undefined

Type

MessageChatAction

AIChatToolbarButtonLabels

Prop

Type

Text shown on the button that clears the chat history.

Type

string | undefined

Text shown on the button that generates a shareable chat link.

Type

string | undefined

Text shown on the button that opens the help options menu.

Type

string | undefined

Text shown on the button that stops the AI from generating a response.

Type

string | undefined

Text shown on the button that copies the chat transcript.

Type

string | undefined

SearchAndChatFilters

Prop

Type

Type

{ [key: string]: any; } | undefined

ComponentsConfig

Prop

Type

Type

((props: { message: Message; renderComponent: (name: string, props: Record<string, unknown>) => React.ReactNode; renderMarkdown: (text: string) => React.ReactNode; }, target: HTMLElement, context: null) => void | React.ReactNode) | undefined

Type

((props: { tool: ToolUIPart; approve: (approved?: boolean) => Promise<void>; renderMarkdown: (text: string) => React.ReactNode; }, target: HTMLElement, context: null) => void | React.ReactNode) | undefined