Sign inGet Started

Publish a batch of Realtime events

POST
/v1/realtime/apps/{realtime_app_id}/batch-events
await bird.realtime.publishBatch("rap_01krdgeqcxet5s7t44vh8rt9mg", {
  events: [
    { event: "order.created", channel: "orders", data: { id: 1 } },
    { event: "order.updated", channel: "orders", data: { id: 2 } },
  ],
});
Antwort200
{
  "data": [
    {
      "channel": "orders-42"
    }
  ]
}

Publishes up to 10 events (each to one channel) in a single request.

Parameter

realtime_app_idstring

ID of the Realtime app (rap_ prefix), as returned when the app was created.

Anfrage-Nutzlast

events
array of object
erforderlich

Up to 10 events per batch.

Untergeordnete Parameter anzeigen

Antwort-Payload

data
array of object

Per-event channel attributes at publish time, present only when at least one event asked for them via include. Positional: one item per event, in request order.

Untergeordnete Attribute anzeigen
data.member_count
integer

Distinct members (presence channels only; requires include=member_count).

data.connection_count
integer

Connections currently subscribed to this channel (requires include=connection_count and the app's connection-counting flag). Channel-scoped: distinct from the app-wide peak connections metric.

data.channel
string
erforderlich

A Realtime channel name. Only letters, digits, and _ - = @ , . ; Prefix with private- or presence- for authenticated channels, or private-encrypted- for channels whose payloads are end-to-end encrypted with a key only you hold.

Weiter mit der Dokumentation, Anleitungen und Beispielen zu diesem Thema.