What You’ll Build
- A shared task list with real-time sync
- Type-safe store operations with schema validation
- Live update rendering when other users make changes
Prerequisites
- A CollabKit server running with a room and users created
@collab-kit/clientand@collab-kit/utilsinstalled
Step 1: Define Your Schema
Create a schema usingdefineStores(). This gives you full type safety and validation:
Schema Rules
required: true— field must be present when callingset()(unless it has adefault)default: value— applied automatically when the field is missing onset()- Fields without
required: truebecome optional in TypeScript types
Step 2: Initialize the Client with Stores
Step 3: Create, Read, Update, Delete
Step 4: Listen for Real-Time Changes
Store events fire when other clients make changes:Step 5: Build the Task Board UI
Multiple Stores
You can define multiple stores for different data types:Syncing on Reconnect
When the client reconnects after a network interruption, callsync() to reload the latest state: