Skip to content

@snort/system

The core Nostr system library providing caching, querying, and relay management.

Installation

bash
bun add @snort/system

Quick Example

typescript
import { NostrSystem, RequestBuilder, EventKind } from '@snort/system'

const System = new NostrSystem({
  automaticOutboxModel: true,
  buildFollowGraph: true,
  checkSigs: true,
})

await System.Init()
await System.ConnectToRelay('wss://relay.snort.social', { read: true, write: true })

const rb = new RequestBuilder('feed')
  .withFilter().kinds([EventKind.TextNote]).limit(50)

const q = System.Query(rb)
q.on('event', (events) => console.log(events))

Sections