Skip to content

vegasdude/synckit

Β 
Β 

SyncKit

True offline-first sync for modern appsβ€”without vendor lock-in

Build Status License Bundle Size TypeScript PRs Welcome

Getting Started β€’ Documentation β€’ Examples β€’ Discussions β€’ Roadmap


🎯 What is SyncKit?

SyncKit is a production-ready sync engine that makes building local-first applications trivial.

"Add sync.document() to your app, get real-time sync automatically."

The problem: Building sync from scratch takes months. Existing solutions are complex (Yjs), expensive (Firebase), or don't work offline (Supabase).

The solution: SyncKit gives you production-ready sync 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 conflicts

🎬 See It In Action

SyncKit Demo

Real-time collaboration with offline resilience: Watch tasks sync instantly across tabsβ€”even while offline. The example app demonstrates SyncKit's offline-first capabilities combined with smart browser storage to create a seamless collaborative experience.


✨ Why SyncKit?

πŸš€ Works When Internet Doesn't

True offline-first architectureβ€”not just caching. Your app works perfectly on planes, trains, tunnels, and coffee shops with spotty WiFi.

πŸ“¦ Enterprise Features, Startup Bundle

~59 KB gzipped (10KB SDK + 49KB WASM) - Complete WASM-based sync engine with TypeScript SDK.

Current features (v0.1.0):

  • βœ… Offline-first sync (LWW)
  • βœ… Real-time collaboration
  • βœ… Network protocol support
  • βœ… IndexedDB persistence
  • βœ… Cross-tab sync (see example)

Coming in v0.2.0:

  • 🚧 Text CRDTs (character-level editing)
  • 🚧 Counters, Sets (distributed data structures)

Size-critical apps? Use Lite variant (~45 KB gzipped: 1.5KB SDK + 44KB WASM, local-only)

Competitive bundle size: Larger than Yjs (~19KB pure JS), smaller than Automerge (~60-78KB).

πŸ”“ Your Data, Your Rules

Open source and self-hostable. No vendor lock-in, no surprise $2,000/month bills, complete data sovereignty.

⚑ Fast by Design

  • <1ms local operations (~5-20ΞΌs single field update)
  • <100ms sync latency (10-50ms p95)
  • ~59KB bundle (10KB SDK + 49KB WASM), ~45KB lite option
  • Sub-200KB total with React

πŸ›‘οΈ Data Integrity Guaranteed

  • Zero data loss with automatic conflict resolution (Last-Write-Wins)
  • Formal verification with TLA+ (3 bugs found and fixed)
  • 700+ comprehensive tests across TypeScript and Rust (unit, integration, chaos, load)

πŸ†š Comparison

Feature SyncKit Firebase Supabase Yjs Automerge
True Offline-First βœ… Native ⚠️ Cache only
(40MB limit)
❌ None
(#357 - 4+ years)
βœ… Full βœ… Full
Works Without Server βœ… Yes ❌ No ❌ No βœ… Yes βœ… Yes
Bundle Size (gzipped) ~59KB
(45KB lite)
~150KB ~45KB ~19KB ~60-78KB
Text CRDT 🚧 v0.2.0 ❌ No ❌ No βœ… Yes βœ… Yes
Counters/Sets 🚧 v0.2.0 ❌ No ❌ No βœ… Yes βœ… Yes
Automatic Conflicts βœ… LWW βœ… LWW ⚠️ Manual βœ… CRDT βœ… CRDT
Self-Hosted βœ… Yes ❌ No βœ… Yes βœ… Yes βœ… Yes
Multi-Language Server βœ… TS
🚧 Py/Go/Rust
❌ No ⚠️ Postgres only ❌ JS only ❌ JS only
Pricing Free (self-host) $25-$2,000+/mo $0-$25/mo Free Free
TypeScript Support βœ… Native βœ… Good βœ… Good ⚠️ Issues βœ… Good
Learning Curve βœ… 5 minutes ⚠️ Medium ⚠️ Medium ⚠️ Steep ⚠️ Complex
Production Status βœ… v0.1.0 ready βœ… Mature βœ… Mature βœ… Mature ⚠️ Alpha/Beta

TL;DR:

  • vs Firebase: No vendor lock-in, true offline, predictable costs
  • vs Supabase: Actually works offline (their #1 issue for 4+ years)
  • vs Yjs: WASM-based for multi-language server support, simpler API for structured data
  • vs Automerge: Smaller bundle, faster performance, production-ready

See detailed migration guides β†’


πŸš€ Quick Start

Installation

npm install @synckit-js/sdk

Your First Synced App

import { 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 (~59 KB gzipped) + React (~130 KB) = ~189 KB total

Size-critical? import { SyncKit } from '@synckit-js/sdk/lite' (~45 KB gzipped, local-only)

Full tutorial (5 minutes) β†’


πŸŽ“ Features

Core Capabilities

  • πŸ”„ 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
  • ⚑ Fast Operations - <1ms local updates, <100ms sync latency
  • πŸ“¦ Compact Bundle - ~59KB gzipped (10KB SDK + 49KB WASM)
  • πŸ” Secure - JWT authentication, RBAC permissions

Framework Integration

  • βš›οΈ React Hooks - useSyncDocument, useSyncField, SyncProvider
  • 🌐 TypeScript Server - Bun + Hono reference implementation
  • πŸ“¦ Multi-Variant - Default (~59KB gzipped) or Lite (~45KB gzipped) builds

Coming in v0.2.0

  • ✍️ Text CRDTs - Collaborative text editing (character-level sync)
  • πŸ”’ Counters - Conflict-free increment/decrement
  • πŸ“‹ Sets & Lists - Observed-Remove Sets for collections
  • 🎨 Framework Adapters - Vue composables, Svelte stores
  • 🌐 Multi-Language Servers - Python, Go, Rust implementations

πŸ—οΈ Architecture

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/Rust] 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 
Loading

Detailed architecture docs β†’


πŸ“š Documentation

Getting Started

Core Concepts

Migration Guides

Examples

Browse all docs β†’


🎯 Use Cases

Tier 1: Simple Object Sync (LWW)

Perfect for: Task apps, CRMs, project management, note apps (80% of applications)

// 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-Wins

Tier 2: Collaborative Text Editing (Coming Soon)

Perfect for: Collaborative editors, documentation, notes

// Note: Text CRDT API is planned for v0.2.0 const text = sync.text('document-456') await text.insert(0, 'Hello ') text.subscribe(content => editor.setValue(content)) // Character-level sync, conflict-free convergence

Tier 3: Custom CRDTs (Coming Soon)

Perfect for: Whiteboards, design tools, specialized apps

// Note: Counter API is planned for v0.2.0 const counter = sync.counter('likes-789') await counter.increment() // Conflict-free counter (additions never conflict)

πŸ“¦ Packages

Core

  • @synckit-js/sdk - Core SDK (TypeScript) + WASM engine
  • @synckit-js/sdk/react - React hooks and components (export from SDK)
  • @synckit-js/sdk/lite - Lightweight version (local-only, 45KB gzipped)

Servers

  • @synckit-js/server - Bun + Hono reference server (production-ready)

🚦 Status

Current Version: v0.1.0 Production Ready: Core sync engine, React hooks, TypeScript server βœ…

What's Complete βœ…

  • βœ… Core Rust Engine - LWW sync engine with CRDT foundation
  • βœ… WASM Compilation - 59KB gzipped (45KB lite), optimized performance
  • βœ… TypeScript SDK - Document API, IndexedDB storage, offline queue
  • βœ… Cross-Tab Sync - Server-mediated sync with operation buffering for multi-tab coordination
  • βœ… React Integration - useSyncDocument, useSyncField, SyncProvider hooks
  • βœ… TypeScript Server - WebSocket sync server with Bun + Hono
  • βœ… Example Applications - Todo app, collaborative editor, project management demos
  • βœ… Documentation - Comprehensive guides and API reference
  • βœ… Build System - Complete toolchain with benchmarks and CI

What's Next 🚧

  • 🚧 Text CRDTs - Collaborative text editing (useText hook) for character-level sync
  • 🚧 Counter CRDTs - Distributed counters (useCounter hook) for conflict-free increments
  • 🚧 BroadcastChannel Cross-Tab - Direct client-to-client sync without server (offline multi-tab)
  • 🚧 Framework Adapters - Vue composables (@synckit-js/sdk/vue), Svelte stores (@synckit-js/sdk/svelte)
  • 🚧 Multi-Language Servers - Python, Go, Rust server implementations (TypeScript complete)
  • 🚧 Advanced Storage - OPFS (Origin Private File System), SQLite adapter
  • 🚧 Conflict UI - Visual conflict resolution interface for complex merge scenarios

Full roadmap β†’


🀝 Contributing

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 Python/Go/Rust servers
  • πŸ’‘ Features - Propose new features in discussions

Contributing guide β†’


🏒 Enterprise

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


πŸ“Š Benchmarks

Bundle Size (gzipped)

Yjs: ~19 KB β–ˆβ–ˆβ–ˆβ–ˆ SyncKit (lite): ~45 KB β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ SyncKit (default): ~59 KB β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ Automerge: ~60-78 KB β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ Firebase: ~150 KB β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ 

Sync Performance

Local update: <1 ms β–ˆβ–ˆβ–ˆβ–ˆ Cross-tab sync: <1 ms β–ˆβ–ˆβ–ˆβ–ˆ Network sync: 10-50 ms β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ Firebase (cold): 2-30 s β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ 

Memory Usage (10K documents)

SyncKit: 3 MB β–ˆβ–ˆβ–ˆβ–ˆ Yjs: 8 MB β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ Automerge: 180 MB β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ 

Detailed benchmarks β†’


πŸ™ Acknowledgments

Built with inspiration from:

  • Yjs - YATA algorithm and performance optimization
  • Automerge - CRDT theory and formal verification
  • Linear - Pragmatic approach to sync
  • Figma - Custom sync architecture patterns
  • RxDB - Local-first database patterns

Special thanks to the local-first community for pioneering this movement.


πŸ“„ License

MIT License - see LICENSE for details.

Copyright (c) 2025 Daniel Bitengo


πŸ”— Links


Built with ❀️ for the local-first future

⭐ Star us on GitHub β€’ πŸ“– Read the docs β€’ πŸš€ Get started

About

πŸ”„ A powerful, type-safe sync engine for building real-time collaborative applications. Local-first, CRDT-based, with zero-config offline support.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 71.9%
  • Rust 17.1%
  • JavaScript 6.7%
  • TLA 1.8%
  • PowerShell 0.6%
  • PLpgSQL 0.6%
  • Other 1.3%