Repository navigation
feat: single broadcast api payload - #1864
Merged
Merged
Conversation
This new endpoint sends a single broadcast with a JSON or binary payload The content-type declares what kind of payload is being sent
leandrocp
requested changes
May 15, 2026
leandrocp
approved these changes
May 19, 2026
|
🎉 This PR is included in version 2.97.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
spydon
added a commit
to supabase/supabase-flutter
that referenced
this pull request
Jun 26, 2026
…y support (#1467) ## What Brings `RealtimeChannel.httpSend()` to parity with supabase-js ([supabase/supabase-js#2400](supabase/supabase-js#2400)). - Uses the new per-event URL format `POST /api/broadcast/{topic}/events/{event}` instead of the old `POST /api/broadcast` with a `messages` array wrapper. - Adds `?private=true` query parameter for private channels. - URL-encodes the topic and event names. - Sends the payload directly (no `messages` wrapper). - `TypedData` (e.g. `Uint8List`) and `ByteBuffer` payloads are sent as `application/octet-stream`; everything else is JSON-encoded. - Returns a clearer error when the server responds with 404 (server too old). The implicit REST fallback in `send()` is intentionally left on the old format, matching supabase-js, which only changed `httpSend()`. ## Compatibility - The `payload` parameter type widens from `Map<String, dynamic>` to `Object` to allow binary payloads. This is backward compatible: existing calls passing a map still compile. - The new endpoint requires Realtime server **v2.97.0+** ([supabase/realtime#1864](supabase/realtime#1864)). This matches supabase-js, which shipped the same change as a minor `feat`. ## Test plan - Updated `httpSend` tests for the new URL format and direct payload body. - Added tests for the `private` query parameter (present for private, absent for public), URL-encoding of special characters, and `Uint8List`/`ByteBuffer` binary payloads. Closes SDK-1018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce?
Introduce a new endpoint:
POST /api/broadcast/:topic/events/:event_namewhere the content-type defines the type of payload (application/jsonvsapplication/octet-stream)if the channel is private a query string can be passed
?private=true