Installation
Maelstrom is distributed as scoped packages so you can install only the layers your app needs. Most React apps start with @maelstrom-co/react in the browser and @maelstrom-co/engine on the server.
Packages
Section titled “Packages”| Package | Purpose |
|---|---|
@maelstrom-co/react |
React bindings — createMaelstrom(), vessel(), hooks, Provider, Chart |
@maelstrom-co/client |
Framework-agnostic client — Orchestrator, connectors, managers |
@maelstrom-co/protocol |
Shared types, Zod schemas, message definitions |
@maelstrom-co/engine |
Server-side LLM decision engine |
Minimal installs by use case
Section titled “Minimal installs by use case”| Use case | Install in the browser app | Install on the server |
|---|---|---|
| React chart only | @maelstrom-co/react |
An engine implementation, commonly @maelstrom-co/engine |
| Framework-agnostic client | @maelstrom-co/client @maelstrom-co/protocol |
An engine implementation |
@maelstrom-co/react depends on the client and protocol packages and re-exports the vessel definition helper plus connector classes (WebSocketConnector, HttpConnector) you need to connect to the engine, so React apps only need to install @maelstrom-co/react. Install @maelstrom-co/client separately only if you are building a framework-agnostic client.
Install
Section titled “Install”# Client-side React appnpm install @maelstrom-co/react
# Server-side reference engine
npm install @maelstrom-co/engine# Client-side React appbun add @maelstrom-co/react
# Server-side reference enginebun add @maelstrom-co/engine# Client-side React apppnpm add @maelstrom-co/react
# Server-side reference engine
pnpm add @maelstrom-co/enginePeer dependencies
Section titled “Peer dependencies”@maelstrom-co/react requires:
react>= 18.0.0react-dom>= 18.0.0
Environment variables
Section titled “Environment variables”The demo engine uses OpenAI. Set the following environment variables:
ENGINE_MODEL= # Optional — defaults to gpt-6-lunaOPENAI_API_KEY=your-key # Demo engine + realtime voice mintOPENAI_REALTIME_MODEL= # Optional — defaults to gpt-realtime-2.1WS_PORT=3001 # Optional — WebSocket port (defaults to 3001)Next steps
Section titled “Next steps”- Quick Start — wire the smallest working chart
- Use a custom LLM provider — choose the model adapter for the reference engine