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?
readonlyoptionalid?:string
Id given to a public topic; absent on a private one.
key
readonlykey: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.