Skip to main content

Requirements

  • Bun ≥ 1.0 (runs TypeScript functions + codegen)
  • Rust ≥ 1.85 (required to build the CLI from source — edition 2024)
  • Node.js ≥ 18 (optional, for client tooling)

Skip the install — use Pylon Cloud

If you don’t want to manage a binary or a server, Pylon Cloud hosts the same backend you’d run yourself. Sign up at cloud.pylonsync.com, then:
pylon login
pylon deploy --target cloud
You’ll still want the CLI for local development and deploys; install it below.

Install the CLI

curl -fsSL https://pylonsync.com/install.sh | bash
The one-line installer downloads a prebuilt binary to ~/.local/bin. Linux and macOS, x86_64 and arm64. No Rust toolchain required. Verify:
pylon --version
pylon doctor
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 don’t have it:
curl -fsSL https://bun.sh/install | bash

Client SDKs

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

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

React Native (iOS + Android)

bun add @pylonsync/sdk @pylonsync/react @pylonsync/react-native
bun add @react-native-async-storage/async-storage expo-sqlite
See Clients → React Native.

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

In your Package.swift:
.package(url: "https://github.com/pylonsync/pylon-swift.git", from: "0.3.0"),
Then per target:
.target(name: "MyApp", dependencies: [
    .product(name: "PylonClient",   package: "pylon-swift"),
    .product(name: "PylonSync",     package: "pylon-swift"),
    .product(name: "PylonSwiftUI",  package: "pylon-swift"),  // optional
])
Linux: apt-get install libsqlite3-dev for the SQLite-backed offline replica. See Clients → Swift.

Directory conventions

A Pylon app usually looks like this:
my-app/
  app.ts                 # schema + policies + manifest
  functions/             # server functions (*.ts)
  client/                # your React components
  web/                   # Vite app (or Next.js, etc.)
    package.json
    vite.config.ts
    src/main.tsx
  package.json
  pylon.manifest.json    # generated
  pylon.client.ts        # generated
pylon dev app.ts watches app.ts + functions/ and regenerates pylon.manifest.json + pylon.client.ts on every change.

Environment variables

VariableDefaultPurpose
PYLON_DB_PATH.pylon/dev.dbSQLite file location (ignored if DATABASE_URL is set)
DATABASE_URL(unset)postgres://... connection string. When set, Pylon uses the Postgres adapter instead of SQLite
PYLON_FILES_DIR.pylon/uploadsFile upload storage
PYLON_CORS_ORIGINfrom manifest.auth.trustedOriginsCORS allowlist override (comma-separated). * only in dev. Loopback always auto-trusted.
PYLON_DEV_MODEtrueDev-only behavior (generous rate limits, CORS * fallback when neither manifest nor env is set)
PYLON_PORT4321HTTP port
PYLON_RATE_LIMIT_MAX100Max anonymous requests per window (per IP). Kept tight — anon traffic is the brute-force surface.
PYLON_RATE_LIMIT_MAX_AUTHED1000Max authenticated requests per window (per user id). Higher than anon because polling dashboards routinely exceed 100/min for a single legit user.
PYLON_RATE_LIMIT_WINDOW60Window in seconds (applies to both anon + authed limits).
PYLON_FN_RATE_LIMIT_MAX30Function calls per window
See Reference → CLI for the full list.