Hero Light Hero Dark

What is kSync?

kSync v0.2 is an enterprise-grade, real-time sync engine that delivers 600k+ operations per second with developer-friendly APIs. Designed for modern web and AI applications that need instant real-time collaboration, streaming support, and production-ready scalability — without the complexity.

Key Features

Why Choose kSync v0.2?

Ready in seconds, not hoursFactory functions with smart defaults mean you can start building real-time features immediately without complex configuration.

Quick Examples

Instant Chat Application

import { createChat } from '@klastra/ksync';

// Chat app with presence and optimized batching
const chat = createChat('my-room', {
  serverUrl: 'ws://localhost:8080'
});

// Set user presence
await chat.setPresence({
  status: 'online',
  metadata: { name: 'Alice', avatar: 'avatar-url' }
});

// Send messages
await chat.send('message', {
  text: 'Hello everyone!',
  author: 'Alice',
  timestamp: Date.now()
});

// Listen for messages
chat.on('message', (data) => {
  console.log(`${data.author}: ${data.text}`);
});

AI Streaming Application

import { createAI } from '@klastra/ksync';

// AI with streaming responses
const ai = createAI('assistant', {
  features: { streaming: true }
});

// Listen for streaming chunks
ai.on('stream-chunk', (data) => {
  process.stdout.write(data.data); // Live AI response
});

// Start AI response stream
await ai.startStream('response-1');
await ai.streamChunk('response-1', { data: 'Hello! ' });
await ai.streamChunk('response-1', { data: 'How can I help?' });
await ai.endStream('response-1');

Basic Real-time Sync

import { createKSync } from '@klastra/ksync';

// Works instantly with smart defaults
const ksync = createKSync();

// Listen for events
ksync.on('message', (data, event) => {
  console.log(`${event.userId}: ${data.text}`);
});

// Send events (instant local, auto-synced if server configured)
await ksync.send('message', {
  text: 'Hello world!',
  timestamp: Date.now()
});

Use Cases

kSync v0.2 is perfect for:
  • 💬 Real-time chat applications with presence, typing indicators, and multi-room support
  • 🎮 Multiplayer games with low-latency updates, player presence, and state synchronization
  • 🤖 AI-powered applications with streaming responses, real-time feedback, and conversation management
  • 📝 Collaborative editing with conflict-free operations and real-time cursors
  • 📊 Live dashboards with real-time data updates and user presence
  • 📋 Project management with task updates, team collaboration, and offline sync
  • 🏪 E-commerce platforms with real-time inventory, cart sync, and customer presence
  • 📱 Mobile applications with offline-first design and automatic sync
  • 🏢 Enterprise tools requiring high performance, security, and reliability

Performance at Scale

Getting Started


kSync v0.2: From prototype to production, without the complexity.