ReferenceAsk
?

AppEvent

Type
One published event delivered to onEvent: the channel, the payload, and when it was published.

The event your onEvent handler receives. id is the platform-stamped publish id, which pairs with channel as the dedupe key when one subscription covers several channels; channel tells you which channel it came in on; data is whatever the backend published, kept small on purpose; ts is when it was published. Read the payload as a nudge and fetch the authoritative record.

AppEvent.ts
interface AppEvent {
  id: string
  channel: string
  data: unknown
  ts: number
}
Fields
id
string
Platform-stamped publish id. One publish is one id; if your grant covers several of the published channels you receive it once per channel, so the dedupe key is id and channel together.
channel
string
The channel the event was published to. Route on it when one subscription covers several channels.
data
unknown
The payload the backend published. Small by design, so it is usually an id to fetch by.
ts
number
Publish time, milliseconds since epoch.
Route by channel
onEvent: (e: AppEvent) => {
  if (e.channel.startsWith('jobs:')) refreshJob((e.data as any).id);
}