Source code:
examples/chat-app/Quick start
Environment variables
| Variable | Description | Default |
|---|---|---|
VITE_POLPO_URL | Polpo API URL (leave empty to use proxy) | — |
VITE_POLPO_API_KEY | Your project API key | — |
VITE_POLPO_AGENT | Default agent name (optional) | — |
Run locally
What’s included
Polpo React SDK integration
The app usesPolpoProvider for context and hooks for data:
Agent selection
On first load, the app fetches available agents usinguseAgents() and displays a selector:
Streaming chat completions
Messages are streamed usingchatCompletionsStream() from the client SDK:
x-session-id) so subsequent messages continue the same conversation.
Session history
Sessions are loaded from the server usinguseSessions():
Tool calls
When the agent executes tools (bash, read, write, etc.), tool call events appear as collapsible blocks showing the tool name, arguments, and result:Abort / Stop
Streaming can be stopped at any time using the Stop button, which callsstream.abort().
Markdown rendering
Responses are rendered using Streamdown with the@streamdown/code plugin for syntax-highlighted code blocks:
Dark / Light theme
Toggle between dark and light mode. Defaults to system preference. Persisted in localStorage.Project structure
Customization
Change the proxy target
Editvite.config.ts to point to a different server:
Add more features
The example is intentionally minimal. You can extend it with:- File attachments — using the attachments API
- Approval gates — using
useApprovals()hook - Task monitoring — using
useTasks()anduseMissions()hooks - Vault credentials — using
useVaultEntries()hook
@polpo-ai/react. See the React SDK docs for the full API.