-
-
Notifications
You must be signed in to change notification settings - Fork 424
Realtime event broadcasting through REST calls does not work #774
Copy link
Copy link
Closed
Description
Describe the bug
When attempting to send a Realtime broadcast without establishing a Web Socket connection from a backend Node application, using the documented channel.send() method, it returns the string error without any explanation.
To Reproduce
Steps to reproduce the behavior:
- Have a supabase project running locally
- Attempt to send a broadcast with the following code
import { createClient } from '@supabase/supabase-js';
import { Env } from '../../config/env';
const supabaseClient = createClient(Env.SUPABASE_URL, Env.SUPABASE_SERVICE_KEY)
supabaseClient.channel('channel1').send({
event: 'event1',
type: 'broadcast',
payload: {
some: 'data'
}
}).then(res => { console.log(res)})- You should see the string "error" as a result, and any connected clients listening to that event won't be notified
Expected behavior
I would expect it to work or at least give an informative reason as to why it is not working.
Desktop (please complete the following information):
- OS: PopOS (linux) and Windows
- Version of CLI 1.127.4
- Version of supabase-js 2.39.2
- Version of Node.js (if applicable) 20.9.0
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels