curl to see it work. For a realtime UI, point the React SDK, Swift SDK, or React Native SDK at the running server. You can also clone one of the example apps.
The rest of this page builds a minimal backend by hand so you can see each piece. It uses a global pylon binary; if you’d rather start from the scaffold above, skip to Concepts.
1. Install the CLI
pylon binary to ~/.local/bin. Linux and macOS, x86_64 and arm64. No Rust toolchain required. (The npm create scaffold above doesn’t need this. It bundles the CLI. Install globally when you want pylon on your PATH for the from-scratch flow below.)
Pylon needs Bun ≥ 1.0 at runtime. It runs your server functions and SSR on Bun.
Verify:
2. Scaffold a new app
apps/api/:
pylon init scaffolds the backend only, with no frontend framework, because Pylon renders React on the server natively. To also generate a separate frontend, pass --frontend react (Vite), --frontend tanstack, or --frontend nextjs, or pick interactively when stdin is a TTY. For a full-stack app with SSR pages, use npm create @pylonsync/pylon (above) instead.
You’ll add a functions/ directory under apps/api/ by hand in step 4.
3. Define the schema
Replaceapps/api/app.ts with:
console.log is required. pylon dev captures stdout as the manifest.
4. Add a server function
Createapps/api/functions/createNote.ts:
POST /api/fn/createNote.
pylon init already adds @pylonsync/sdk + @pylonsync/functions to apps/api/package.json. If you skipped init or removed the deps, install them manually:
5. Run the server
pylon dev does four things:
- auto-discovers
app.ts(andschema.tsfor legacy projects). - watches
app.tsandfunctions/*.ts. - auto-migrates the database (SQLite at
.pylon/dev.dbby default, Postgres ifDATABASE_URLis set). - serves the API on
http://localhost:4321.
6. Call the API
Create a guest session:TOKEN with the value from above):
Next steps
Entities
All the field types and index options.
Policies
How row-level access rules work.
Functions
Queries, mutations, actions, validators.
Live queries
How
db.useQuery stays in sync.Testing
pylon test — pure logic, components, functions over HTTP.- React: the chat example — schema, functions, Vite app, live subscriptions
- Swift / SwiftUI: the swift-todo example — minimal iOS/macOS app with optimistic mutations
- React Native: the chat example ports cleanly to RN with the
@pylonsync/react-nativebridge
Hand the rest to a coding agent
Once your backend runs, the rest happens in the shell. Pylon Cloud has a one-paste handoff flow that signs your coding agent (Claude Code, Codex, OpenCode, Cursor, Aider, grok build) into your account, installs the Pylon skill, and asks what to build. No token enters the chat history. From there the agent can use the full CLI surface:pylon secrets, pylon logs tail, pylon deploy, pylon domains add, pylon db backup, pylon data list <Entity>, etc.