You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Realtime Broadcast can now send and receive binary payloads in addition to JSON. This lets you broadcast compact binary data without the overhead of JSON encoding.
Binary payloads are supported across every way you send a Broadcast message: the client libraries (over WebSocket), the REST API, and directly from your database.
When to use binary payloads
Binary shines whenever your data is numeric, high-frequency or densely packed. In these cases JSON's textual encoding adds significant overhead.
Sensor and telemetry streams. Connected devices emit steady streams of numeric readings. These can be temperature, accelerometer values, GPS coordinates, battery levels, etc. They can be packed into fixed-width binary fields, where a reading that takes 20–30 characters as JSON text fits in just a few bytes across thousands of devices.
Screenshot and presentation streaming. A presenter or support agent shares a live view by broadcasting periodic image frames (JPEG/PNG) to viewers. Each frame is transient and inherently binary, so there's no need for durable storage and no reason to pay the base64 tax. Just send the image bytes straight to everyone watching.
Usage
Client libraries (WebSocket)
Pass an ArrayBuffer/ArrayBufferView (Uint8Array for example) or the equivalent in non-JS SDKs as the payload.
REST API
Single-message endpoint where Content-Type selects application/json vs application/octet-stream. channel.httpSend() from JS.
Database
realtime.send_binary() with a bytea payload.
Minimum versions
WebSocket (supabase-js): 2.91.0
WebSocket (supabase-swift): 2.44.0
REST API through httpSend (supabase-js): 2.107.0
We are in the process of adding support to binary payloads across all SDKs.
⚠️ Binary payloads sent to clients on older SDK versions (or SDKs that don't support binary payloads) are silently dropped.
More information can generally be found in the Broadcast page of the Realtime guides.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Realtime Broadcast can now send and receive binary payloads in addition to JSON. This lets you broadcast compact binary data without the overhead of JSON encoding.
Binary payloads are supported across every way you send a Broadcast message: the client libraries (over WebSocket), the REST API, and directly from your database.
When to use binary payloads
Binary shines whenever your data is numeric, high-frequency or densely packed. In these cases JSON's textual encoding adds significant overhead.
Usage
Client libraries (WebSocket)
Pass an
ArrayBuffer/ArrayBufferView(Uint8Arrayfor example) or the equivalent in non-JS SDKs as the payload.REST API
Single-message endpoint where
Content-Typeselectsapplication/jsonvsapplication/octet-stream.channel.httpSend()from JS.Database
realtime.send_binary()with a bytea payload.Minimum versions
2.91.02.44.0httpSend(supabase-js):2.107.0We are in the process of adding support to binary payloads across all SDKs.
More information can generally be found in the Broadcast page of the Realtime guides.
Beta Was this translation helpful? Give feedback.
All reactions