Deploy to production
Deploy OrchaJS agents with your existing npm run build and production environment keys.
Your production workflow does not need a separate Orcha build configuration. Use the build command your project already uses:
npm run buildOrcha is compiled and included as part of the application build. The same agent folders and runtime API you used locally are used in production.
Configure production credentials
Provide model-provider credentials through your deployment environment:
ANTHROPIC_API_KEY=...Do not copy a local .env file into the production bundle.
Deploy the application
Deploy the output of npm run build the same way you deploy the rest of your
Node.js application. No playground frontend is included in the production
output.
Application code remains unchanged:
import "./orcha/index.js";
import { orcha } from "orchajs";
const result = await orcha.assistant.run(
"Explain durable sessions.",
).result;Preserve durable sessions
The default Node storage writes sessions under .orcha/sessions. Use
persistent shared storage when a session must:
- survive a process or container restart,
- resume on another application instance,
- wait for a client action and continue later.
Read sessions through get(), history(), events(), and list() rather
than accessing storage files directly.
Production checklist
- Run
npm run buildin CI. - Run focused agent tests before deployment.
- Supply provider credentials through the production environment.
- Keep
.orcha/sessionson persistent storage when sessions must resume. - Save
sessionIdin your application database when users may return later. - Await
execution.evaluationsin short-lived jobs when scores must finish before the process exits.