# Native Nostr events

Use standard kinds and Applesauce instances.

## Work with standard kinds


```ts
await db.events.publish({
  kind: 1,
  created_at: Math.floor(Date.now() / 1000),
  tags: [],
  content: "Hello Nostr",
});
const notes = await db.events.query({ kinds: [1], authors: [pubkey], limit: 20 });
const listener = db.events.subscribe({ kinds: [1] }, event => console.log(event));
listener.unsubscribe();

// db.pool and db.eventStore are the real Applesauce instances.
```

Use `publishSigned` for an event signed outside the SDK. Incoming and outgoing events are verified. Supply `pool`, `eventStore`, `relayOptions`, or a custom `transport` to integrate an existing Applesauce app. `close()` cancels subscriptions and starts resource cleanup. `await closeAsync()` also waits for queue shutdown and pending persistence writes; use it when durability matters. Injected pools/stores and external signers remain owned by the app.
