This version (v0.7) has not been published to npm yet.
Skip to content

Reference / @getenginex/sdk/extension / Topic

Topic<TMessage> ​

Descriptor of a topic, created by the factory that defineTopic returns and passed to realtime.subscribe and realtime.onResync. A frozen object; it only holds data, with no connection state. Opaque to apps: create it with the factory (coreTopics.balance(), predictionsTopics.orderbook({ marketId })) and pass it along without reading or building the fields; only TMessage (the type of the message delivered to the handler) is a contract for the app.

Type Parameters ​

TMessage ​

TMessage

Properties ​

id? ​

readonly optional id?: string

Id given to a public topic; absent on a private one.


key ​

readonly key: string | null

Full topic at the gateway, e.g. 'market:m-1'. null on a private topic: realtime builds ${prefix}:${sub} with the session's user at subscription time.