True offline-first sync for modern appsโwithout vendor lock-in
Getting Started โข Documentation โข Examples โข Discussions โข Roadmap
Build collaborative apps in hours, not months.
SyncKit is a production-ready sync engine that gives you everything for local-first collaboration:
- Rich text editing with conflict resolution (Peritext + Fugue CRDTs)
- Undo/redo that syncs across tabs and sessions
- Live presence and cursor sharing
- Framework adapters for React, Vue, and Svelte
"Add
sync.document()to your app, get real-time sync automatically."
The reality: Building sync from scratch takes months. SyncKit gives you production-ready collaboration in 3 lines of code.
const sync = new SyncKit()
await sync.init()
const doc = sync.document<Todo>('todo-123')
await doc.update({ completed: true })
// โจ Works offline, syncs automatically, resolves conflictsLocalWrite - Full-featured collaborative editor showcasing SyncKit's capabilities.
Quick test (30 seconds):
- Open localwrite-demo.fly.dev in two browser tabs
- Click "Join a Room" in both tabs (auto-joins same room)
- Type in one tab โ appears instantly in the other
- Watch live cursors showing each user's position
What you'll see:
- Character-level sync - No debouncing, no lag
- Conflict-free merging - Multiple users editing simultaneously
- Block-based editor - Slash commands (
/h1,/list) with real-time formatting - Presence & cursors - See who's online, where they're typing
- Offline-first - Disconnect your network, keep editing, auto-sync on reconnect
- Word Wall - Community voting feature (bonus: shows OR-Set CRDT in action)
Real-world example:
import { SyncKit } from '@synckit-js/sdk'
import { useSyncDocument } from '@synckit-js/sdk/react'
// Initialize once
const sync = new SyncKit()
await sync.init()
// Use in components
function TaskList() {
const [tasks, { update }] = useSyncDocument<Task[]>('tasks')
const toggleTask = (id: string) => {
update(tasks.map(t =>
t.id === id ? { ...t, completed: !t.completed } : t
))
}
// Syncs across all connected clients automatically
}True offline-first architectureโnot just caching. Your app works perfectly on planes, trains, tunnels, and coffee shops with spotty WiFi.
154KB gzipped - Complete local-first sync solution with everything you need.
What you get:
- โ Text editing (Fugue CRDT) - Collaborative editing that just works
- โ Rich text formatting (Peritext) - Bold, italic, links with conflict resolution
- โ Undo/redo - Syncs across tabs, persists across sessions
- โ Real-time presence - See who's online, what they're editing
- โ Cursor sharing - Watch teammates type in real-time
- โ Counters & Sets - Distributed data structures for app state
- โ Framework adapters - React, Vue, Svelte (choose what you need)
- โ Offline-first sync - Works perfectly without internet
- โ IndexedDB persistence - Unlimited local storage
Size-critical apps? Use Lite variant (46KB gzipped, basic sync only)
Every byte is justified. We chose completeness over minimal sizeโrich text, undo/redo, cursors, and framework adapters all work together out of the box.
Open source and self-hostable. No vendor lock-in, no surprise $2,000/month bills, complete data sovereignty.
- <1ms local operations (~5-20ฮผs single field update)
- <100ms sync latency (10-50ms p95)
- 154KB bundle (complete solution), 46KB lite option
- ~310KB total with React (comparable to React alone)
- Zero data loss with automatic conflict resolution (Last-Write-Wins)
- Formal verification with TLA+ (3 bugs found and fixed)
- 2,100+ comprehensive tests across TypeScript, Rust, Python, Go, and C# (unit, integration, chaos, load)
npm install @synckit-js/sdkimport { SyncKit } from '@synckit-js/sdk'
import { SyncProvider, useSyncDocument } from '@synckit-js/sdk/react'
// Initialize (works offline-only, no server needed!)
const sync = new SyncKit()
await sync.init()
function App() {
return (
<SyncProvider synckit={sync}>
<TodoApp />
</SyncProvider>
)
}
function TodoApp() {
const [todo, { update }] = useSyncDocument<Todo>('todo-1')
if (!todo || !todo.text) return <div>Loading...</div>
return (
<div>
<input
type="checkbox"
checked={todo.completed}
onChange={(e) => update({ completed: e.target.checked })}
/>
<span>{todo.text}</span>
</div>
)
}That's it! Your app now:
- โ Works 100% offline
- โ Syncs across tabs automatically
- โ Persists data in IndexedDB
- โ Resolves conflicts automatically
Bundle: SyncKit (154KB gzipped) + React (156KB) = ~310KB total
Size-critical? import { SyncKit } from '@synckit-js/sdk/lite' (46KB gzipped, local-only)
- โ๏ธ Text CRDT (Fugue) - Collaborative editing with conflict-free convergence
- ๐จ Rich Text (Peritext) - Bold, italic, links with proper formatting merge
- โฉ๏ธ Undo/Redo - Cross-tab undo that syncs everywhere
- ๐ฅ Awareness & Presence - See who's online and what they're editing
- ๐ฑ๏ธ Cursor Sharing - Real-time cursor positions with smooth animations
- ๐ข Counters & Sets - Distributed counters (PN-Counter) and sets (OR-Set)
- โ๏ธ React Hooks - Complete hook library for all features
- ๐ข Vue Composables - Idiomatic Vue 3 Composition API integration
- ๐ถ Svelte Stores - Reactive Svelte 5 stores with runes support
- ๐ Real-Time Sync - WebSocket-based instant sync across devices
- ๐ด Offline-First - Works perfectly with zero connectivity
- ๐๏ธ Local Persistence - IndexedDB storage, unlimited capacity
- ๐ Conflict Resolution - Automatic Last-Write-Wins (LWW) merge for documents, CRDTs for collaboration
- โก Fast Operations - <1ms local updates, <100ms sync latency
- ๐ฆ Production Bundle - 154KB gzipped (complete) or 46KB (lite)
- ๐ Secure - JWT authentication, RBAC permissions
graph TD
A[Your Application<br/>React/Vue/Svelte] --> B[SyncKit SDK<br/>TypeScript]
B -->|Simple API| B1[document, text, counter]
B -->|Framework adapters| B2[React/Vue/Svelte hooks]
B -->|Offline queue| B3[Storage adapters]
B --> C[Rust Core Engine<br/>WASM + Native]
C -->|80% of use cases| C1[LWW Sync]
C -->|Collaborative editing| C2[Text CRDTs]
C -->|Advanced features| C3[Custom CRDTs<br/>counters, sets]
C --> D[IndexedDB Storage<br/>Your local source of truth]
D -.->|Optional| E[SyncKit Server<br/>TypeScript/Python/Go/C#]
E -->|Real-time sync| E1[WebSocket]
E -->|Persistence| E2[PostgreSQL/MongoDB]
E -->|Security| E3[JWT auth + RBAC]
style A fill:#e1f5ff,stroke:#333,stroke-width:2px,color:#1a1a1a
style B fill:#fff4e1,stroke:#333,stroke-width:2px,color:#1a1a1a
style C fill:#ffe1e1,stroke:#333,stroke-width:2px,color:#1a1a1a
style D fill:#e1ffe1,stroke:#333,stroke-width:2px,color:#1a1a1a
style E fill:#f0e1ff,stroke:#333,stroke-width:2px,color:#1a1a1a
Detailed architecture docs โ
- 5-Minute Quick Start - Build your first synced app
- Installation Guide - Setup instructions
- API Reference - Complete API documentation
- Offline-First Patterns - True offline architecture
- Conflict Resolution - Automatic LWW merge strategy
- Performance Optimization - Bundle size, memory, sync speed
- Testing Guide - Property-based tests, chaos engineering
- From Firebase/Firestore - Escape vendor lock-in
- From Supabase - Add offline support
- From Yjs/Automerge - Simplify your stack
- LocalWrite Demo - Full-featured collaborative editor (live demo, see source in
demo/) - Vanilla Counter - Minimal example with no build tools (just open in browser!)
- Todo App - Simple CRUD with filters
- Collaborative Editor - Real-time text editing with CodeMirror 6
- Project Management - Production-grade kanban app with drag-and-drop
Perfect for: Task apps, CRMs, project management, note apps (80% of applications)
import { SyncKit } from '@synckit-js/sdk'
import { useSyncDocument } from '@synckit-js/sdk/react'
// Initialize once
const sync = new SyncKit()
await sync.init()
// Use anywhere
const doc = sync.document<Project>('project-123')
await doc.update({ status: 'completed' })
// Conflicts resolved automatically with Last-Write-WinsPerfect for: Collaborative editors, documentation, notes
import { useSyncText } from '@synckit-js/sdk/react'
const [text, { insert, delete: del }] = useSyncText('document-456')
await insert(0, 'Hello ')
// Character-level sync, conflict-free convergencePerfect for: Likes, votes, tags, participants
import { useCounter, useSet } from '@synckit-js/sdk/react'
const [count, { increment, decrement }] = useCounter('likes-789')
await increment() // Conflict-free counter
const [tags, { add, remove }] = useSet<string>('post-tags')
await add('typescript') // Observed-remove setDifferent libraries make different trade-offs. Here's how SyncKit compares:
| Feature | SyncKit | Firebase | Supabase | Yjs | Automerge |
|---|---|---|---|---|---|
| Bundle Size (gzipped) | 154KB (46KB lite) |
~150โ200KB (typical client) |
~45KB (JS client) |
65KB (core) |
300KB+ (JS/WASM) |
| Text CRDT | โ Fugue | โ No | โ No | โ Y.Text | โ Yes |
| Rich Text | โ Peritext | โ No | โ No | โ Yes | |
| Undo/Redo | โ Cross-tab | โ No | โ No | โ Yes | |
| Awareness/Cursors | โ Built-in | โ No | โ No | โ No | |
| Framework Adapters | โ React/Vue/Svelte | โ No | โ No | โ No | |
| True Offline-First | โ Native | โ No native support | โ Full | โ Full | |
| Works Without Server | โ Yes | โ No | โ No | โ Yes | โ Yes |
| Self-Hosted | โ Yes | โ No | โ Yes | โ Yes | โ Yes |
| TypeScript Support | โ Native | โ Good | โ Good | โ Good | |
| Production Status | โ v0.3.0 | โ Mature | โ Mature | โ Mature | evolving ecosystem |
Choose SyncKit if:
- โ You need rich text, undo/redo, cursors, and framework adapters included
- โ You want Vue or Svelte support (not just React)
- โ You value shipping fast over optimizing every byte
- โ You want true offline-first without vendor lock-in
Choose alternatives if:
- Firebase/Supabase: You need a full backend-as-a-service (auth, storage, functions) and offline sync isn't critical
- Yjs: Minimal bundle size is your #1 priority and you're okay wiring up separate plugins for undo, presence, and framework support.
- Automerge: You need JSON patching or unique Automerge features (and can accept 300KB+ bundle)
See detailed migration guides โ
@synckit-js/sdk- Core SDK (TypeScript) + WASM engine@synckit-js/sdk/react- React hooks and components (export from SDK)@synckit-js/sdk/vue- Vue 3 composables (export from SDK)@synckit-js/sdk/svelte- Svelte 5 stores with runes (export from SDK)@synckit-js/sdk/lite- Lightweight version (local-only, 46KB gzipped)
@synckit-js/server- Bun + Hono TypeScript server (production-ready)- Python Server - FastAPI implementation (production-ready, v0.3.0)
- Go Server - High-performance goroutine-based server (production-ready, v0.3.0)
- C# Server - ASP.NET Core implementation (production-ready, community-contributed)
Current Version: v0.3.0
The core sync engine is battle-tested and ready for production:
- โ Document Sync - LWW conflict resolution with vector clocks
- โ Text CRDT (Fugue) - Collaborative text editing with conflict-free convergence
- โ Rich Text (Peritext) - Bold, italic, links with formatting conflict resolution
- โ Counters & Sets - PN-Counter and OR-Set CRDTs
- โ Offline-First Architecture - Works perfectly without internet
- โ WebSocket Protocol - Real-time server synchronization
- โ Core Rust Engine - Memory-safe WASM with zero unsafe blocks
- โ WASM Compilation - 154KB gzipped (46KB lite), optimized performance
- โ TypeScript SDK - Document, Text, RichText, Counter, Set APIs
- โ Storage Adapters - IndexedDB, Memory, and OPFS
- โ Multi-Language Servers - TypeScript, Python, Go, and C# (all production-ready)
- โ Undo/Redo - Cross-tab undo with persistent history
- โ Awareness & Presence - Real-time user tracking with cursor sharing
- โ Cross-Tab Sync - BroadcastChannel-based synchronization
- โ Framework Adapters - React hooks, Vue 3 composables, Svelte 5 stores
- โ Quill Integration - QuillBinding for Quill editor
- โ Snapshot API - Document snapshots with automatic scheduling
- โ Benchmark Suite - Cross-server performance comparison
- โ 2,100+ Tests - 100% pass rate across TypeScript, Rust, Python, Go, and C#
- โ Example Applications - Todo app, collaborative editor, project management
- ๐ง Rust Server - Native Rust server implementation
- ๐ง SQLite Storage - For Node.js, Bun, and Electron
- ๐ง SQL Sync - Multi-table relational sync
- ๐ง Conflict UI - Visual conflict resolution interface
We welcome contributions from the community!
Ways to contribute:
- ๐ Bug Reports - Open an issue
- ๐ Documentation - Improve guides, fix typos
- ๐งช Tests - Add test coverage
- ๐ Servers - Implement Rust server
- ๐ก Features - Propose new features in discussions
Need enterprise support?
- ๐ฏ Managed Hosting - We host SyncKit servers for you
- ๐ Priority Support - 24/7 support, SLA guarantees
- ๐ Monitoring & Analytics - Dashboard, alerts, insights
- ๐ Training & Consulting - Onboarding, architecture review
Contact: danbitengo@gmail.com
SyncKit (lite): 46 KB โโโโโโโโ
Yjs (assembled): 65 KB โโโโโโโโโโโ
SyncKit (default): 154 KB โโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Firebase: 150 KB โโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Automerge: 300 KB โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Local update: <1 ms โโโโ
Cross-tab sync: <1 ms โโโโ
Network sync: 10-50 ms โโโโโโโโ
Firebase (cold): 2-30 s โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
SyncKit: 3 MB โโโโ
Yjs: 8 MB โโโโโโโโโ
Automerge: 180 MB โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
SyncKit's core algorithms are based on published research:
- Fugue CRDT - Matthew Weidner & Martin Kleppmann, "The Art of the Fugue: Minimizing Interleaving in Collaborative Text Editing" (2023). Solves the interleaving problem in collaborative text editing.
- Peritext - Geoffrey Litt, Sarah Lim, Martin Kleppmann & Peter van Hardenberg, "Peritext: A CRDT for Rich-Text Collaboration" (2021). Provides conflict-free rich text formatting.
Built with inspiration from:
- Loro - Production Fugue+Peritext implementation that influenced our Rust architecture
- Yjs - Text CRDT concepts and performance optimization
- Automerge - CRDT theory and formal verification
- Linear - Pragmatic approach to sync
- Figma - Custom sync architecture patterns
- RxDB - Local-first database patterns
- Ink & Switch - Research lab pioneering local-first software
Special thanks to the local-first community for pioneering this movement.
MIT License - see LICENSE for details.
Copyright (c) 2025 Daniel Bitengo
- Documentation - Complete guides and API reference
- GitHub - Source code
- Issues - Bug reports and features
- Roadmap - Development timeline
- Discussions - Community discussions
- LinkedIn - Connect and follow updates
Built with โค๏ธ for the local-first future
โญ Star us on GitHub โข ๐ Read the docs โข ๐ Get started