Skip to main content

Requirements

  • Bun ≥ 1.0 is a runtime dependency. The pylon server binary spawns Bun as a child process to run TypeScript functions and render React SSR. Every install path below except Stack0 Cloud needs Bun on the host.
  • Rust: a recent stable toolchain (edition 2021). You need it only if you build the CLI from source. The prebuilt binary and Docker image need no Rust.
  • Node.js ≥ 18 (optional, for client tooling)

Fastest start: scaffold an app

The quickest path to a running full-stack app is the project scaffolder. It needs no global install, because it adds @pylonsync/cli as a dev dependency:
This scaffolds a full-stack SSR app (schema, policies, functions, and file-based React routes under app/). npm run dev runs the bundled CLI. Install the standalone CLI below if you want pylon on your PATH for other projects or CI.

Skip the install: use Stack0 Cloud

If you do not want to manage a binary or a server, Stack0 Cloud hosts the same backend you would run yourself. Sign up at www.pylonsync.com/dashboard, then:
You will still want the CLI for local development and deploys. Install it below.

Install the CLI

The one-line installer downloads a prebuilt binary to ~/.local/bin. It supports Linux and macOS, on x86_64 and arm64. It needs no Rust toolchain. Verify:
pylon doctor checks that bun, node, and the supporting tooling are available.

Install Bun

Pylon uses Bun to run TypeScript server functions and to bundle the client code generator. If you do not have it:

Client SDKs

Web (React, Next.js, Vite, vanilla JS)

For Next.js, also add @pylonsync/next. See Clients → React and Clients → Next.js.

React Native (iOS + Android)

See Clients → React Native.

Swift (iOS, macOS, tvOS, watchOS, Linux)

In your Package.swift:
Then per target:
Linux: apt-get install libsqlite3-dev for the SQLite-backed offline replica. See Clients → Swift.

Directory conventions

A Pylon app usually looks like this:
pylon dev app.ts watches app.ts and functions/, and regenerates pylon.manifest.json and pylon.client.ts on every change.

Environment variables

Dev shortcuts

Dev mode turns on shortcuts that give full control of the app:
  • dev_code / dev_token in magic-code, email-verification, phone, and magic-link responses
  • POST /api/auth/session and /api/auth/upgrade for any user id
  • the OAuth callback’s email parameter in place of a provider code
  • /admin/* and /metrics without a token (when no PYLON_ADMIN_TOKEN is set)
  • the dev file API and /_pylon/dev/render
They answer only requests from this machine: the connection comes from a loopback address, the Host header is localhost, *.localhost, 127.x.x.x, [::1], or the Android emulator’s 10.0.2.2, and the Origin header, if sent, is a localhost page. A request from another device, through a tunnel such as ngrok, from a page that re-pointed its own domain at 127.0.0.1, or from another website open in your browser is served as production. A local proxy that rewrites Host to localhost (ngrok --host-header=rewrite, a Vite proxy with changeOrigin, editor port forwarding) makes remote callers look local, so don’t run one on an untrusted network. pylon dev --host 0.0.0.0 lets your phone reach the dev server, and the phone signs in the normal way: email codes print to the pylon dev terminal when no email provider is set. See the CLI reference for the full list.