Install
Install the core SDK, then add one package per axis. You do not need every package. Compose only what your stack uses.
Core
npm i @hitl-sdk/hitl@hitl-sdk/hitl provides the server, inbox API, field builders, and the internal HTTP API.
Workflow resolver (pick one)
| Engine | Package | Docs |
|---|---|---|
| Workflow SDK | @hitl-sdk/resolver-workflow-sdk + workflow | Workflow SDK |
| Temporal | @hitl-sdk/resolver-temporal + @temporalio/client + @temporalio/workflow | Temporal |
| Inngest | @hitl-sdk/resolver-inngest + inngest | Inngest |
# Workflow SDK (default)
npm i @hitl-sdk/resolver-workflow-sdk workflow
# Temporal
npm i @hitl-sdk/resolver-temporal @temporalio/client @temporalio/workflow
# Inngest
npm i @hitl-sdk/resolver-inngest inngestIf you use Vercel Workflow SDK, configure its world (runtime storage and queues) separately from Hitl's state backend below.
State backend (pick one)
In-memory is the default when you omit state. Use a persistent backend for production or multi-replica deploys.
| Backend | Package | When to use |
|---|---|---|
| in-memory | built into @hitl-sdk/hitl | Local dev, single process |
| SQLite | @hitl-sdk/state-sqlite | Local dev, small deploys, Node 22.13+ |
| Postgres | @hitl-sdk/state-pg + pg | Production, existing Postgres |
| Redis | @hitl-sdk/state-ioredis + ioredis | Production, existing Redis |
npm i @hitl-sdk/state-sqlite
# or
npm i @hitl-sdk/state-pg pg
# or
npm i @hitl-sdk/state-ioredis ioredisSee State docs for setup and migrations.
Delivery (optional add-on)
The web inbox is always included. No extra package required. Add the Chat SDK adapter only when you need Slack, Teams, Discord, or other chat platforms:
npm i @hitl-sdk/adapter-chat-sdk chat @chat-adapter/slackInstall @chat-adapter/* packages for each platform you use. See Chat SDK adapter.
Choose your stack
Use this table to jump to the detailed doc for each axis of your stack.
| Your choice | Covers | Doc |
|---|---|---|
| Workflow SDK | workflowResolver + workflow client | workflow-engines/workflow-sdk |
| Temporal | temporalResolver + activity-backed client | workflow-engines/temporal |
| Inngest | inngestResolver + step.invoke wiring | workflow-engines/inngest |
| SQLite | state in new Hitl() | state/sqlite |
| Postgres | state in new Hitl() | state/postgres |
| Redis | state in new Hitl() | state/redis |
| Web inbox only | Built-in hitl.inbox (default) | channels/web-inbox |
| Slack / Teams / … | Channel adapters in new Hitl() | channels/chat-sdk |
| Next.js | Internal API route mounting | host-integration#nextjs |
| Express / Hono / … | Internal API route mounting | host-integration |
Recommended default for new projects: Workflow SDK + SQLite + web inbox + Next.js, same as the Quickstart.
Environment variables
| Variable | Where | Purpose |
|---|---|---|
HITL_SECRET | Server | Bearer token for the internal workflow → server API |
HITL_URL | Workflow / Inngest runtime | Base URL for hitl HTTP calls (when not inferred) |
HITL_POSTGRES_URL | Server | Postgres connection for @hitl-sdk/state-pg |
REDIS_URL | Server | Redis connection for @hitl-sdk/state-ioredis |
TEMPORAL_ADDRESS | Server | Temporal frontend for @hitl-sdk/resolver-temporal |
Without HITL_SECRET, the internal API is open in development and a warning is logged once.