Skip to Content
Introduction

Synap SDK

Event-sourced personal data platform SDK for building modern applications with complete audit trails.

pnpm add @synap/sdk

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

Features: Vite + React, Design System Studio, BYOK auth, instant HMR

β†’ View on GitHubΒ 

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 dev

Features: Next.js 15, Ory Kratos, RBAC, Server Components, Design Studio

β†’ View on GitHubΒ 


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
Last updated on