Hey everyone, I've been excited to try out realtim...
# help
j
Hey everyone, I've been excited to try out realtime + RLS on a side project for a while and finally digging into it. I'm using hosted Supabase but no matter how much I dig through the docs, I can't find a reference for which websocket URL to use for my project. Probably obvious, but could anybody point me in the right direction? Thanks!
Further to this, I found a reference to the following structure: ws://.supabase.co/socket
but this doesn't connect at all.
l
The Javascript SDK builds the realtime url this way: this.realtimeUrl =
${supabaseUrl}/realtime/v1
.replace('http', 'ws')
so it is ws://.supabase.co/realtime/v1
j
Thanks for your reply @User, but unfortunately that doesn't work 😦
Copy code
const client = new RealtimeClient('ws://<projectID>.supabase.co/realtime/v1');
client.connect();
Yields:
Copy code
WebSocket connection to 'ws://<projectID>.supabase.co/realtime/v1/websocket?vsn=1.0.0' failed
(Obviously I'm replacing my ID, just keeping them out of chat for now :))
I get the same when I sub
ws
for
wss
When I pass
{ params: { apiKey: jwt } }
(where
jwt
is a valid client JWT), the same thing happens.
Have opened a GH Discussion, linking for reference: https://github.com/supabase/supabase/discussions/4754#discussion-3774718