Synap SDK
Event-sourced personal data platform SDK for building modern applications with complete audit trails.
pnpm add @synap/sdkWhy Synap SDK?
40% Less Code than raw tRPC
Simple, intuitive API that handles complexity for you.
Event Sourcing Built-In
Every change logged as immutable events - complete audit trails out of the box.
Production Ready
Battle-tested infrastructure with automatic retries, multi-user isolation, and integrated file storage.
π Quick Start with Templates
Skip the setup and jump straight into building with our ready-made starter templates:
Light Starter (Personal Tools)
Perfect for personal productivity tools, internal dashboards, and rapid MVPs.
npx degit Synap-core/synap-starter my-app
cd my-app && npm install && npm run devFeatures: Vite + React, Design System Studio, BYOK auth, instant HMR
Enterprise Starter (Multi-Tenant SaaS)
Production-ready Next.js app with Ory Kratos authentication and RBAC.
npx degit Synap-core/synap-enterprise my-saas
cd my-saas && npm install && npm run devFeatures: Next.js 15, Ory Kratos, RBAC, Server Components, Design Studio
Quick Example
import { SynapSDK } from '@synap/sdk'
// Initialize once
const synap = new SynapSDK({
url: 'https://api.synap.app',
apiKey: process.env.SYNAP_API_KEY
})
// Create entity (event-sourced mutation)
const { entityId } = await synap.entities.create({
type: 'task',
title: 'Review PR #123',
metadata: { priority: 'high', dueDate: '2024-12-25' }
})
// Create relationship
await synap.relations.create(taskId, personId, 'assigned_to')
// Query data (direct read - fast!)
const tasks = await synap.entities.list({ type: 'task' })
// Access complete history
const history = await synap.events.getHistory(entityId)Time to first API call: < 5 minutes
Core Features
π― Event Sourcing
Every mutation creates an immutable event record. Get complete audit trails, time travel, and event replay for free.
// View complete history
const history = await synap.events.getHistory(entityId)
// Every create, update, delete - all tracked foreverπ Type-Safe
Full TypeScript support with autocomplete for entity types, metadata, and relationship types.
// TypeScript knows what fields exist
const task = await synap.entities.create({
type: 'task', // Autocomplete!
metadata: {
priority: 'high' // Type-checked!
}
})π Universal Relationships
Link any entity to any entity with typed relationships.
// Assign task to person
await synap.relations.create(taskId, personId, 'assigned_to')
// Create task dependencies
await synap.relations.create(task1, task2, 'depends_on')
// Tag anything
await synap.relations.create(entityId, tagId, 'tagged_with')β‘ Fast Queries
All queries are direct database reads - no event processing delay.
// Instant reads
const tasks = await synap.entities.list({ type: 'task' })
const results = await synap.entities.search({ query: 'urgent' })π Complete Audit Trail
Track who changed what, when, and why. Perfect for compliance and debugging.
// See every change forever
const events = await synap.events.getHistory(entityId)
events.forEach(e => {
console.log(`${e.createdAt}: ${e.eventType} by ${e.userId}`)
})π Framework Agnostic
Works everywhere: Next.js, React, Vue, Node.js, and more.
Get Started
π Getting Started
Install and configure the SDK in 2 minutes
π§ Core Concepts
Understand event sourcing and architecture
π API Reference
Complete documentation for all APIs
π‘ Examples
Build a task manager step-by-step
π§ Next.js Guide
Integrate with App Router and Pages Router
π Relations API
Master entity relationships
What You Can Build
- Task Managers - With assignments, dependencies, and priorities
- Note-Taking Apps - With tags, links, and full-text search
- CRM Systems - With contacts, companies, and relationships
- Project Trackers - With milestones, tasks, and teams
- Knowledge Bases - With bi-directional links and history
Event Sourcing Benefits
Traditional apps store only current state. Synap SDK stores every change as an immutable event.
You Get:
- β Complete audit trail (who, what, when)
- β Time travel (replay to any point)
- β Event replay for debugging
- β Real-time updates via webhooks
- β Data recovery (never lose anything)
Without:
- β Complex migration logic
- β Manual audit logging
- β Lost historical data
Learn more about Event Sourcing β
Developer Experience
// Intuitive API
await synap.entities.create({ ... }) // Create
await synap.entities.update(id, { ... }) // Update
await synap.entities.list({ ... }) // Query
await synap.entities.delete(id) // Delete
// Universal relationships
await synap.relations.create(a, b, type)
await synap.relations.getRelated(id, { ... })
// Event history
await synap.events.getHistory(id)
await synap.events.getTimeline({ ... })Clean. Simple. Powerful.
Ready to Build?
Get Started β in less than 5 minutes
Or explore:
Built with β€οΈ for developers who value data integrity