---
url: >-
  https://game-engine-io.github.io/enginex-frontend-sdk/reference/api/@getenginex/sdk/extension/interfaces/Topic.md
---
[Reference](../../../../index.md) / [@getenginex/sdk/extension](../index.md) / Topic

# Topic\<TMessage>

Descriptor of a topic, created by the factory that [defineTopic](../functions/defineTopic.md) 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.
