nostrbasedocs
Start building
API reference
.md

Read the native nostr events guide. Signatures below come from the published SDK declarations. Access SDK services through db; use their constructors only when integrating at a lower level.

ApplesauceTransport

/** Applesauce owns connection reuse, Nostr wire messages, and reconnect behavior. */
declare class ApplesauceTransport implements Transport {}

Properties

readonly pool: RelayPool;

constructor

constructor(pool: RelayPool);

request

request(
  relays: string[],
  filters: Filter[],
  options: {
    timeout: number;
    signal: AbortSignal;
  },
): Promise<TransportRead>;

publish

publish(
  relays: string[],
  event: NostrEvent,
  options: {
    timeout: number;
    signal: AbortSignal;
  },
): Promise<RelayResult[]>;

subscribe

subscribe(relays: string[], filters: Filter[]): Observable<NostrEvent>;

Search guides, API methods, and protocols.