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 } },
  ],
});
Réponse200
{
  "data": [
    {
      "channel": "orders-42"
    }
  ]
}

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

Paramètres

realtime_app_idstring

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

Corps de la requête

events
array of object
obligatoire

Up to 10 events per batch.

Afficher les paramètres enfants

Contenu de la réponse

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.

Afficher les attributs enfants
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
obligatoire

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.

Poursuivez avec la documentation, les guides et les exemples sur ce sujet.