Skip to content

Search is only available in production builds. Try building and previewing the site to test it out locally.

Concepts

Reactor is designed around a small set of ideas that stay constant whether you are on a laptop or in production. This page explains the mental model so the CLI, SDK, and server behavior make sense together.

Every Reactor project is defined by reactor.toml at the project root. The CLI walks up the directory tree to find it (stopping at the git root), similar to how package.json or Cargo.toml work.

project_id = "my-app-a1b2c3d4"
name = "My Application"
default_context = "local"
[data]
migrations_dir = "data/migrations"
[[functions]]
name = "hello"
source = "functions/hello"
runtime = "wasm"
entry = "index.ts"
[[sites]]
name = "web"
source = "sites/web"
framework = "static"
[[jobs]]
name = "nightly-rollup"
function = "rollup"
trigger = { type = "cron", schedule = "0 0 * * *" }
FieldPurpose
project_idStable identifier linking local project to server-side records
nameHuman-readable display name
default_contextWhich named server connection to use when --context is omitted
[data]Migration directory and data-related settings
[[functions]]Declarative function registry — name, source path, runtime
[[sites]]Site name, source directory, framework (static, nextjs, etc.)
[[jobs]]Scheduled or event-driven work pointing at a function

Global CLI state — contexts, credentials, default context — is stored in ~/.reactor/config.toml:

default = "production"
[contexts.local]
endpoint = "http://localhost:8080"
[contexts.production]
endpoint = "https://api.reactor.cloud"
org = "acme"
[contexts.production.auth]
kind = "keychain"
service = "reactor"
account = "production"

Keep secrets out of reactor.toml. Use reactor login, keychain storage, or CI environment variables.

A context is a named connection to a Reactor server: an endpoint URL, optional org, and auth configuration.

Terminal window
reactor context add staging --endpoint https://staging.example.com --org acme
reactor context use staging
reactor deploy

Contexts let you:

  • Switch between local, staging, and production without editing files.
  • Share the same project repo across environments.
  • Override per-invocation with --context or REACTOR_CONTEXT.
Terminal window
reactor context list
reactor context show production
reactor deploy --context staging

Token resolution order: --token flag → REACTOR_TOKEN env → context-specific env → OS keychain.

Reactor exposes eight user-facing capabilities. Each one follows the same pattern:

  1. HTTP API — versioned routes (/auth/v1, /data/v1, /fn/v1, …)
  2. SDK module@reactor/auth, @reactor/data, etc., composed in @reactor/client
  3. CLI verbsreactor functions …, reactor data …, reactor jobs …
  4. Rust trait + adapters — swappable backends per deployment grade
┌─────────────────────────────────────────────────────────┐
│ Your application │
│ (SDK, curl, or CLI scripts) │
└─────────────────────────┬───────────────────────────────┘
│ HTTP
┌─────────────────────────▼───────────────────────────────┐
│ reactor-server │
│ ┌─────────┐ ┌──────┐ ┌─────────┐ ┌───────────┐ │
│ │ Identity│ │ Data │ │Functions│ │ Sites │ ... │
│ └────┬────┘ └──┬───┘ └────┬────┘ └─────┬─────┘ │
│ │ │ │ │ │
│ └─────────┴──────────┴────────────┘ │
│ Shared Postgres │
└─────────────────────────────────────────────────────────┘
CapabilityAPI prefixSDK accessorCLI prefix
Identity/auth/v1reactor.authreactor login, org commands
Data/data/v1reactor.from(), reactor.rpc()reactor data
Storage/storage/v1reactor.storage(SDK-first today)
Functions/fn/v1reactor.functionsreactor functions
Jobs/jobs/v1reactor.jobsreactor jobs
Sites/sites/v1reactor.sitesreactor sites
Gateway/gateway/v1@reactor/ai(config-driven)
Connect/connect/v1@reactor/connect(config-driven)

Capabilities can be enabled or disabled at the server level via cargo features and server config. Your project manifest declares what your app uses; the server decides what is available.

Deployment topologies describe where and how Reactor runs, expressed as <Edition><Size>@<platform>. The invariant:

The same SDK call, CLI command, and project file work on every topology. Adapters differ; semantics are uniform up to documented contract differences.

TokenNameTargetIdentityData storeFunctions runtime
O1LocalDesktop / dev binaryEmbeddedSQLite + RLS simulationIn-process WASM
O2Single nodeOne VPS, Docker ComposeEmbedded or externalPostgreSQLDocker subprocess / WASM
O4Managed cloudFly, Render, RailwayReactor IdentityManaged PostgresFly Machines / Workers
E6EnterpriseCustomer AWS / GCPReactor on EKS/ECSRDS / AuroraLambda / Fargate
C6Reactor.cloudHosted by AtomicoLabsReactor IdentityPer-region PostgresFirecracker microVMs
If you need…Start with
Fastest local iterationO1 / reactor dev
Cheap single-server productionO2 on a VPS
Minimal ops, managed infraO4 or C6
Compliance, existing cloud contractE6

Under the hood, each capability is a Rust trait with multiple adapters — one per deployment topology.

Capability trait (stable API contract)
├── size 1 adapter (SQLite, local FS, in-process)
├── size 2 adapter (Postgres, local/MinIO, Docker)
├── size 4 adapter (Neon, R2, Fly Machines)
└── C6 adapter (Reactor.cloud managed)

As an application developer you rarely touch adapters directly. You:

  1. Write SQL migrations and RLS policies (Data).
  2. Export HTTP handlers from function files (Functions).
  3. Declare resources in reactor.toml.
  4. Call the SDK or CLI.

Reactor operators choose adapters when configuring reactor-server or selecting a hosted plan.

TopologyWhat happens when you call reactor.functions.invoke('hello')
O1In-process WASM handler, localhost only
O2WASM or container subprocess on the same host
C6Request routed to an isolated microVM, cold start possible

The invoke API and response shape stay the same.

Reactor supports multi-tenant SaaS through organizations:

  • Users belong to one or more orgs with roles.
  • Data rows are scoped by org via RLS.
  • Contexts can include --org to set the active org.

Every authenticated Data request sets Postgres session variables:

VariableMeaning
reactor.user_idAuthenticated user’s UUID
reactor.org_idActive organization
reactor.roleUser’s role in that org

RLS policies reference these variables. Service-role keys bypass RLS for admin tasks.

Key typeUse caseRLS
rk_pub_…Browser / mobile clientsEnforced
rk_svc_…Server-side, CI, adminBypassed

reactor build produces a bundle — a compressed archive of everything needed to run your app on a target server:

  • SQL migrations
  • Compiled function artifacts
  • Site static assets or framework build output
  • Manifest snapshot

.reactorignore excludes files (like node_modules/ and .env) from bundles, similar to .dockerignore.

reactor deploy uploads the bundle, applies migrations, and rolls out functions and sites atomically per project.

reactor.toml ~/.reactor/config.toml
│ │
│ project resources │ server connections
▼ ▼
reactor build ──► bundle ──► reactor deploy ──► reactor-server
@reactor/client ◄──── HTTP ──────────┘
  1. Develop locally with reactor dev (sizes 1–2 embedded).
  2. Declare functions, sites, and jobs in reactor.toml.
  3. Connect to remote servers via contexts.
  4. Deploy with reactor build && reactor deploy.
  5. Call the same SDK against any grade.
  • Introduction — platform overview and who Reactor is for.
  • Quickstart — install CLI and run your first server.
  • Adapters — operator-focused adapter reference.
  • Configuration — server-side config and env overrides.