ByteChef LogoByteChef
PlatformAutomationBuildAI HubWorkflow Chats

Embed the Chat Widget

Drop the @bytechef/chat React widget into your own app and point it at a chat-enabled workflow.

A chat-enabled workflow in Embedded Chat mode needs your own UI. The @bytechef/chat React package provides a chat widget that calls the New Chat Request webhook and renders the replies, including streamed replies, questions, and approval requests.

Install

npm install @bytechef/chat

Add the widget

Set webhookUrl to your workflow's chat webhook URL. Append /sse to receive streamed replies:

import {AutomationChat} from '@bytechef/chat';

export function SupportChat() {
    return (
        <AutomationChat
            config={{
                description: 'Ask anything about your account.',
                suggestions: [
                    {label: 'Track an order', prompt: 'Where is my order?', title: 'Where is my order?'},
                    {label: 'Manage billing', prompt: 'Cancel my subscription', title: 'Cancel my subscription'},
                ],
                title: 'Support Assistant',
                webhookUrl: 'https://<your-host>/webhooks/<webhook-id>/sse',
            }}
        />
    );
}

Components

ExportDescription
AutomationChatThe full chat surface, rendered inline in your page.
AutomationChatModalA floating launcher button that opens the chat in a modal. The position prop accepts bottom-right (default), bottom-left, top-right, or top-left.
AutomationChatProviderThe context provider used by both components. Use it with the exported Thread component and useSSE hook to build a custom layout.

Configuration

Pass the configuration as the config prop.

OptionTypeDefaultDescription
webhookUrlstring-Required. The workflow's webhook URL. When it ends with /sse, replies are streamed.
titlestringHello there! (Chat in the modal)Welcome message title. In AutomationChatModal, the modal title.
descriptionstringHow can I help you today?Welcome message description. In AutomationChatModal, the modal's accessible description.
suggestions{title, label, prompt}[]-Suggested prompts shown on the welcome screen.

The widget sends message, conversationId, and attachments to the webhook as multipart/form-data and renders the reply.

How is this guide?

Last updated on

On this page