Examples Guide
This repo includes three runnable example apps. Each one maps cleanly to a section of the docs.
qa-bot
Path: examples/qa-bot
Live demo: qa-bot
Use this example for:
- the core
Chatcomponent initialMessages- free-form follow-up handling with
userResponseCallback - plain action buttons created with
createButton
Docs:
Run it:
bash
pnpm --filter qa-bot-example devlogin
Path: examples/login
Live demo: login
Use this example for:
createRequestInputButtonDefcreateRequestConfirmationButtonDef- validators, retries, and abort behavior
- password masking and
rawContent
Docs:
Run it:
bash
pnpm --filter login-example devsettings
Path: examples/settings
Live demo: not published because this example requires an API key.
Use this example for:
react-actions-chat-recommended-actionscreateVectorSearchQueryRecommendedActionsFlowVectorSearchButtonDefinitioncreateOpenAITextEmbedder
Docs:
Run it:
bash
pnpm --filter settings-example devIf you want to run the settings demo with real embeddings, create examples/settings/.env.local with:
bash
VITE_OPENAI_API_KEY=your_openai_api_keyThat keeps the example easy to run locally, but production apps should move embedding calls behind a backend service.