A demo chat application using the Factory Droid SDK with a React frontend and Express backend.
- Node.js 18+
- Factory CLI installed, and authenticated via login or the
FACTORY_API_KEYenvironment variable
npm installnpm run devThis starts both:
- Backend (Express + WebSocket) on http://localhost:3001
- Frontend (Vite + React) on http://localhost:5173
Open http://localhost:5173 in your browser.
The backend starts a Droid SDK session with the claude-opus-4-7 model and enables the app's configured tools: Execute, Read, Create, Edit, Glob, Grep, LS, and WebSearch.
To verify the configured tools are available for the selected model:
npm run tools:checkThis is an example app for demonstration purposes. For production use, consider:
-
Isolate the Droid SDK - Move the SDK into a separate container/service. This provides better security isolation since the agent can access configured tools such as command execution, file operations, and web search.
-
Persistent storage - Replace the in-memory
ChatStorewith a database. Currently all chats are lost on server restart. -
Transcript syncing - For Droid sessions to be persisted across server restarts, you'll need to persist and restore the SDK's conversation state. The SDK maintains internal state for multi-turn conversations that must be synced with your storage.
-
Authentication - Add user authentication and authorization. Currently anyone can access any chat.

