Skip to content

EventsAPI

Defined in: namespaces.ts:572

Host events (legacy pair) + the fn-70 typed event bus.

The legacy subscribe/unsubscribe pair is a PERMANENT alias (ADR-001) — it is not deprecated, but new inter-plugin messaging should use the typed-bus methods, which add schema validation, retention, and delivery modes. Typed-bus scopes: events.topic.declare, events.emit, events.subscribe, events.replay, events.inspect, plus contributor scopes events.serializer.register / events.sink.register.

subscribe(eventName, handler): string

Defined in: namespaces.ts:574

Subscribes to a host event. Returns subscription token.

string

(payload) => void

string


unsubscribe(token): void

Defined in: namespaces.ts:576

Cancels a host event subscription.

string

void


declareTopic(spec): Promise<void>

Defined in: namespaces.ts:580

Declares a schema-registered topic. [events.topic.declare]

TopicSpec

Promise<void>


emitTopic(name, payload, metadata?): Promise<void>

Defined in: namespaces.ts:582

Emits a payload to a declared topic. [events.emit]

string

unknown

Record<string, unknown>

Promise<void>


subscribeTopic(name, handler): Promise<string>

Defined in: namespaces.ts:584

Subscribes to a topic. Resolves to a subscription token. [events.subscribe]

string

(envelope) => void

Promise<string>


replay(name, opts?): Promise<EventEnvelope[]>

Defined in: namespaces.ts:586

Replays retained events for a topic. [events.replay]

string

number

string

Promise<EventEnvelope[]>


listTopics(): Promise<TopicInfo[]>

Defined in: namespaces.ts:588

Lists visible declared topics. [events.inspect]

Promise<TopicInfo[]>