The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
docs: Add Kotlin broadcasting via REST and Realtime authorization docs (#33234)
Jan Tennert95594570b0ce
diff --git a/apps/docs/content/guides/realtime/authorization.mdx b/apps/docs/content/guides/realtime/authorization.mdxindex 437dd724acc..a10121f12ed 100644--- a/apps/docs/content/guides/realtime/authorization.mdx+++ b/apps/docs/content/guides/realtime/authorization.mdx@@ -183,6 +183,19 @@ Then, to join a topic with RLS enabled, instantiate the Channel with the `privatprint("Connected!")```+ </TabPanel>+ <TabPanel id="kotlin" label="Kotlin">+ ```kotlin+ val channel = supabase.channel("room-1") {+ isPrivate = true+ }+ channel.broadcastFlow<MyPayload>(event = "test").onEach {+ println(it)+ }.launchIn(scope) // launch in your coroutine scope+ channel.subscribe(blockUntilSubscribed = true)+ println("Connected!")+ ```+</TabPanel><TabPanel id="python" label="Python">```pydiff --git a/apps/docs/spec/supabase_kt_v3.yml b/apps/docs/spec/supabase_kt_v3.ymlindex 76b31398e9a..b375a697e46 100644--- a/apps/docs/spec/supabase_kt_v3.yml+++ b/apps/docs/spec/supabase_kt_v3.yml@@ -4643,8 +4643,6 @@ functions:}.launchIn(coroutineScope) // launch a new coroutine to collect the flowchannel.subscribe(blockUntilSubscribed = true)-- channel.broadcast(event = "message", Message("I joined!", "John"))```- id: listen-to-presence-updatesname: Listen to presence updates@@ -4830,7 +4828,41 @@ functions:You have two methods you can use if you want to listen for updates on a specific database row:- `postgresSingleDataFlow` fetches the initial data matching the filter and then emits updates based on realtime events.- `postgresChangeFlow` emits the raw data received by realtime. To filter the realtime queries, use the `filter` method.-+ - id: broadcast-message+ title: broadcastMessage()+ description: |+ Broadcast a message to all connected clients to a channel.+ notes: |+ - When using REST you don't need to subscribe to the channel+ $ref: '@supabase/realtime-js.RealtimeChannel.send'+ examples:+ - id: send-a-message+ name: Send a message via websocket+ isSpotlight: true+ code: |+ ```kotlin+ val channel = supabase.channel("room1")+ channel.subscribe(blockUntilSubscribed = true)+ channel.broadcast("cursor-pos", message = buildJsonObject {+ put("x", 10)+ put("y", 20)+ })+ ```+ response: |+ ```+ ok | timed out | error+ ```+ - id: send-a-message-via-rest+ name: Send a message via REST+ isSpotlight: true+ code: |+ ```kotlin+ val channel = supabase.channel("room1")+ channel.broadcast("cursor-pos", message = buildJsonObject {+ put("x", 10)+ put("y", 20)+ })+ ```- id: remove-channeldescription: |Unsubscribes and removes Realtime channel from Realtime client.