SourcingChat
Drop-in sourcing chat. Pass chatId for an existing chat, or leave it empty to create one on the first message. Replace slots to render the same session with your own pieces.
ICU nurses in Texas
Ready
Who are you looking for?
Describe the person in your own words.
Search on this page is answered with sample candidates.
Example
import { SourcingChat, SourcingClient, SourcingProvider } from '@search-engine-sdk/react';
import '@search-engine-sdk/react/styles.css';
const client = new SourcingClient({ baseUrl: '/api/v2' });
export function SourcingPanel() {
return (
<SourcingProvider client={client}>
<SourcingChat title="ICU nurses in Texas" theme="light" />
</SourcingProvider>
);
}
Props
| Prop | Type | |
|---|---|---|
chatId | string | Existing chat. Omit to create one on the first send. |
title | string | Title stored with the chat when the SDK allocates an id. |
theme | 'light' | 'dark' | 'system' | Default system, from prefers-color-scheme. |
tokens | ThemeTokens | Replaces built-in colors, radius, and font. Inline values win over light and dark presets. |
className | string | Added on the root element. |
classes | { root?, body?, thread?, side? } | Host classes on those elements. |
slots | SourcingChatSlots | Replaces a view and keeps the same session. |
onChatCreated | (chat) => void | Fires with { id, title } when the SDK allocates an id locally. |
onNewSearch | (text) => void | Handles a separate-search suggestion. Required to show that action with a controlled chatId. |
onReview | (candidateId, 'like' | 'dislike') => void | Host handler for candidate feedback. |
onSnapshot | (snapshot) => void | Every controller snapshot. |
onError | (error: Error) => void | A failed turn. message is the banner text. |
slots replaces a view and keeps the same session. The names are Header, Transcript, Message, Progress, QuickReplies, Composer, Filters, Candidates, Empty, and Error.
useSourcingClient() throws when SourcingProvider is missing. Give the panel a bounded height. The transcript and the results list scroll inside it.