Skip to content

Realtime event broadcasting through REST calls does not work #774

@FranciscoMessina

Description

@FranciscoMessina

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:

  1. Have a supabase project running locally
  2. 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)})
  1. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions