SkillAgentSearch skills...

Synckit

πŸš€ Local-first collaboration SDK for React, Vue, and Svelte. Batteries-included: Rich text, undo/redo, cursors, and presence.

Install / Use

/learn @Dancode-188/Synckit

README

SyncKit

<div align="center">

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

npm version Build Status License Bundle Size TypeScript PRs Welcome

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

</div>

🎯 What is SyncKit?

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 conflicts

🎬 See It In Action

⚑ Try Live Demo β†’

LocalWrite - Full-featured collaborative editor showcasing SyncKit's capabilities.

Quick test (30 seconds):

  1. Open localwrite-demo.fly.dev in two browser tabs
  2. Click "Join a Room" in both tabs (auto-joins same room)
  3. Type in one tab β†’ appears instantly in the other
  4. 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
}

✨ 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.

πŸ“¦ Production-Ready, Feature-Complete

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.

πŸ”“ 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)
  • 154KB bundle (complete solution), 46KB lite option
  • ~310KB total with React (comparable to React alone)

πŸ›‘οΈ Data Integrity Guaranteed

  • 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)

πŸš€ 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 (154KB gzipped) + React (156KB) = ~310KB total

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

Full tutorial (5 minutes) β†’


πŸŽ“ Features

Text Editing & Collaboration

  • ✍️ 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)

Framework Integration

  • βš›οΈ 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

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

πŸ—οΈ 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/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 β†’


πŸ“š Documentation

Getting Started

Core Concepts

Migration Guides

Examples

View on GitHub
GitHub Stars646
CategoryDevelopment
Updated1d ago
Forks21

Languages

TypeScript

Security Score

100/100

Audited on Mar 27, 2026

No findings