npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@synap-core/sdk

v0.2.0

Published

High-level SDK for Synap - Event-sourced personal data platform

Readme

@synap/sdk

High-level SDK for Synap - Event-sourced personal data platform

Installation

pnpm add @synap/sdk

Quick Start

import { SynapSDK } from '@synap/sdk';

// Initialize SDK
const synap = new SynapSDK({
  url: 'https://api.synap.app',
  apiKey: 'your-api-key'
});

// Create entity (event-sourced)
const { entityId } = await synap.entities.create({
  type: 'task',
  title: 'Call Marie tomorrow',
  metadata: {
    dueDate: '2024-12-20',
    priority: 'high'
  }
});

// Create relationship (event-sourced)
await synap.relations.create(entityId, personId, 'assigned_to');

// Query data (direct reads)
const tasks = await synap.entities.list({ type: 'task' });
const history = await synap.events.getHistory(entityId);

Architecture

Event Sourcing

All mutations go through event sourcing:

  • entities.create/update/deleteevents.log → Inngest worker → Database
  • relations.create/deleteevents.log → Inngest worker → Database

All queries are direct database reads:

  • entities.get/list/search → Direct query
  • relations.get/getRelated → Direct query
  • events.getHistory → Direct query

Benefits

  • Audit trail: Every change logged as immutable event
  • Time travel: Replay events to see past states
  • Reliability: Workers handle async processing with retries
  • Real-time: Events trigger webhooks and SSE broadcasts

API Reference

Entities API

// Create
const { entityId } = await synap.entities.create({
  type: 'note',
  title: 'Meeting Notes',
  content: '# Discussion points...'
});

// Update
await synap.entities.update(entityId, {
  title: 'Updated Title'
});

// Delete (soft delete)
await synap.entities.delete(entityId);

// Get
const entity = await synap.entities.get(entityId);

// List
const notes = await synap.entities.list({
  type: 'note',
  limit: 20
});

// Search
const results = await synap.entities.search({
  query: 'project planning',
  types: ['note', 'task']
});

Relations API

// Create relationship
await synap.relations.create(
  sourceEntityId,
  targetEntityId,
  'assigned_to'
);

// Get relations
const relations = await synap.relations.get(entityId, {
  type: 'assigned_to',
  direction: 'both' // 'source' | 'target' | 'both'
});

// Get related entities
const people = await synap.relations.getRelated(taskId, {
  type: 'assigned_to',
  direction: 'source'
});

// Get statistics
const stats = await synap.relations.getStats(entityId);
// Returns: { total, outgoing, incoming, byType }

// Delete relationship
await synap.relations.delete(relationId);

Events API

// Get entity history
const history = await synap.events.getHistory(entityId, {
  eventTypes: ['entities.create.validated'],
  limit: 100
});

// Get user timeline
const timeline = await synap.events.getTimeline({
  limit: 50
});

// Replay events to rebuild state
const state = await synap.events.replay(entityId);

Entity Types

type EntityType = 
  | 'task'
  | 'note'
  | 'person'
  | 'event'
  | 'file';

Relation Types

type RelationType =
  | 'assigned_to'    // Task → Person
  | 'mentions'       // Note → Entity
  | 'links_to'       // Note → Note
  | 'parent_of'      // Project → Task
  | 'relates_to'     // Generic
  | 'tagged_with'    // Entity → Tag
  | 'created_by'     // Entity → Person
  | 'attended_by'    // Event → Person
  | 'depends_on'     // Task → Task
  | 'blocks';        // Task → Task

License

AGPL-3.0