Event streams
Use this reference with the complete developer tour and TypeScript types. The example at the end runs after the tour setup.
events
Section titled “events”Consume authorized canonical events with reconnect and a sequence checkpoint.
events(options?: EventOptions): AsyncGenerator<BeepgridEvent, any, any>| Parameter | Type and default | Usage |
|---|---|---|
options |
EventOptions (default {}) |
Optional fields supported by this operation, listed in the linked HTTP input. Unknown fields are not a supported extension mechanism. |
Returns: Python iterator or TypeScript async iterator of events; Go callback with error return.
Permissions, lifecycle and errors: Persist a checkpoint after applying each event. Go options add conversation filtering; Python supports conversation_id; TypeScript EventOptions exposes after, summary and signal. Summary streams omit full bodies. A denial stops reconnecting.
Declared return type: AsyncGenerator<BeepgridEvent, any, any>.
Working TypeScript example. Input/output fields are in the types reference.
Example
Section titled “Example”Run this region after the shared setup. Assertions check the returned data; the full tour is a runnable program.
for await (const event of billing.events({ signal: AbortSignal.timeout(5000) })) { if (event.kind === 'message.created' && event.conversation_id === sent.conversation_id) { const checkpoint = event.sequence; // Persist after applying the event in your application. assert.ok(checkpoint > 0); break; }}