realtime websocket failed to connect

here is the code snippet,
side note RLS is enabled
import { RealtimeClient } from '@supabase/realtime-js'
const socket = new RealtimeClient(
  'wss://<project-ref-id>.supabase.co/realtime/v1'
)
socket.connect()
    const channel = socket.channel('public:user')
    channel.on(
      'postgres_changes',
      { event: '*', schema: 'public', table: 'user' },
      (e) => console.log('payload ', e)
    )
    channel.subscribe()
Was this page helpful?