Skip to main content
Pylon’s wire format is plain HTTP + WebSocket + JSON. You can talk to it with fetch and a WebSocket from any language. But Pylon ships first-party SDKs that handle the bookkeeping — auth tokens, optimistic mutations, reconnection, CRDT decoding, typed entities — so you don’t reinvent them.

Available SDKs

PackageUse it for
@pylonsync/sdkSchema DSL + manifest builder. Required for codegen.
@pylonsync/reactReact hooks: useQuery, useMutation, useShard, useSession, useSearch, useAggregate, useInfiniteQuery
@pylonsync/react-nativeReact Native + Expo: SQLite-backed offline replica, AsyncStorage adapter
@pylonsync/nextNext.js App Router: Server Actions, RSC data fetching, middleware-friendly auth
Swift SDKiOS / macOS / tvOS / watchOS / Linux native — PylonClient, PylonSync, PylonRealtime, PylonSwiftUI
@pylonsync/syncThe sync engine — local store, mutation queue, WebSocket/SSE/poll transports. Used by every JS SDK; can be used standalone in non-React apps.
@pylonsync/loroLoro CRDT integration — collaborative text/lists/maps/trees that converge across clients

Picking the right combination

App typeUse
Web SPA (React)@pylonsync/sdk + @pylonsync/react
Server-rendered web (Next.js)@pylonsync/sdk + @pylonsync/react + @pylonsync/next
iOS / macOS nativeSwift SDK
iOS + Android (cross-platform)@pylonsync/sdk + @pylonsync/react-native
Vite SPA, Vue, Svelte, Solid@pylonsync/sdk + @pylonsync/sync (call directly, no React)
CLI / server-to-server@pylonsync/sdk (HTTP only)
Real-time multiplayerSame as above + @pylonsync/react’s useShard (or PylonRealtime on Swift)
Collaborative editorAdd @pylonsync/loro (or PylonSync Loro bridge on Swift)
The SDKs share the same wire formats; you can use @pylonsync/react on the web, the Swift SDK on iOS, and @pylonsync/react-native on Android — they all agree about what a ChangeEvent looks like, and CRDT bytes are identical across platforms because they wrap the same Loro Rust core.

Common quickstart

Every SDK shares the same shape. The TypeScript flow:
import { configureClient } from "@pylonsync/react";

configureClient({ baseUrl: "https://your-app.com" });

// Sign in
await startMagicLink("alice@example.com");
const session = await verifyMagicLink("alice@example.com", code);

// Use entities
const todos = await fetchList("Todo");

// Or via sync engine for live updates + optimistic writes
import { createSyncEngine } from "@pylonsync/sync";
const engine = createSyncEngine("https://your-app.com");
await engine.start();
await engine.insert("Todo", { title: "ship it", done: false });
The Swift flow (mirror image):
import PylonClient
import PylonSync

let client = PylonClient(baseURL: URL(string: "https://your-app.com")!)
try await client.startMagicCode(email: "alice@example.com")
_ = try await client.verifyMagicCode(email: "alice@example.com", code: code)

let cfg = SyncEngineConfig(baseURL: URL(string: "https://your-app.com")!)
let engine = await SyncEngine(config: cfg, client: client)
await engine.start()
_ = await engine.insert("Todo", ["title": "ship it", "done": false])

Codegen

Every SDK supports typed access via pylon codegen:
# TypeScript (default)
pylon codegen client pylon.manifest.json --out client.ts

# Swift
pylon codegen client pylon.manifest.json --target swift --out PylonGenerated.swift
Generated files emit:
  • Entity types — Codable structs (Swift), interface declarations (TS) per entity
  • Function signatures — typed args and results
  • Typed client extensionsclient.listTodos(), client.createTodo(NewTodo(...)) instead of stringly-typed APIs
Run codegen on every manifest change. Add it to your build script.

Wire compatibility guarantees

Pylon treats wire format as a stability contract — never break it without a major version bump. The SDKs evolve independently of the binary; a v0.2.x client works against a v0.3.x server within the same minor.

Where to next

Pick your platform and dive in: TypeScript, React, React Native, Next.js, Swift, sync engine, or Loro CRDTs.