HighX

Getting started

Install, create a project, run it locally, deploy it to Cloudflare.

Requirements

  • Bun 1.3+ for the CLI. The libraries themselves run under Node 18+ or any bundler.
  • A Cloudflare account — only for deploying. Everything else runs locally.

1. Install

bun add -d highx
bun add @highx/core @highx/runtime @highx/cloudflare
bun add @highx/client @highx/react   # if you have a browser UI

Every package moves on one version. See packages for what each one is and which you need.

2. Create a project

bunx highx create my-notes
cd my-notes
bun install

create scaffolds only the files a project owns. highx init remains an alias:

highx/highx.config.ts    the deployment — name, stages, retention
highx/functions.ts       your schema, queries, and mutations
highx/index.ts           the tenant object and your routes
highx/auth.config.ts     who your callers are, and what they may do
highx/retention.ts       how long operational storage is kept
package.json             merged into an existing one if you have one
.env.local               a session secret for local runs, and Cloudflare credentials

It never overwrites an existing file, so it is safe to run inside a project you have already started.

3. Generate

bunx highx generate
✓ .highx/api.ts, .highx/server-api.ts, .highx/auth.ts (2 functions)
    query    notes.list                   true
    mutation notes.save                   true
✓ wrangler.jsonc
✓ highx/highx-env.d.ts (2 bindings)

That writes the typed client API, the platform configuration, and the ambient Env type. You never hand-write a binding — generate reads which ones your code uses. Re-run it whenever you add or rename a function.

generate finds highx.config.ts in the working directory or in highx/, so run it from the project root.

4. Run it locally

bunx wrangler dev

Open two tabs and add a note in one. The other updates immediately — no refresh, no polling.

What just happened

Each tab opened one WebSocket and subscribed to notes.list. The tenant Durable Object ran the query and recorded which index it read. Your mutation committed and emitted the keys it touched. The engine matched those keys to live subscriptions and sent each one a patch.

5. Deploy

bunx highx doctor      # is this project configured correctly?
bunx highx provision   # create D1, KV, and R2 resources it binds to
bunx highx deploy
bunx highx secret put SESSION_SECRET

Secrets attach to a Worker that exists, so the first time the order is deploy → set secrets → deploy again. doctor reporting the secret as missing in between is accurate, not a problem to fix.

A project that binds only a Durable Object has nothing to provision — Cloudflare creates those during the deploy. See deployment for the full sequence and what to verify afterwards.

Adding HighX to an existing project

HighX does not need to own your repository. Point the config at your entry and your functions, and send the generated API wherever your frontend imports from:

highx.config.ts
export default defineConfig({
  adapter: cloudflare(),
  name: "my-app",
  entry: "worker.ts",
  functions: "src/app.ts",
  output: "src/generated",
});

Next

On this page