happenator
05/24/2023, 1:55 PMError: WebSocket Constructor: The protocols array cannot be empty.
when calling client.subscribe
. I assume it has something to do with the Cloudflare runtime environment not being a full Node environment.happenator
05/24/2023, 2:35 PMclass WebSocketProxy extends WebSocket {
public constructor(url: string, protocols?: string | string[]) {
super(url, protocols?.length ? protocols : undefined);
}
}
...
const client = new RealtimeClient(env.REALTIME_URL, {
params: {
apikey: env.SUPABASE_KEY,
eventsPerSecond: 10,
},
// @ts-ignore
transport: WebSocketProxy,
});
happenator
05/24/2023, 2:36 PM@supabase/realtime-js
or @supabase/supabase-j
? Both seem to implement similar functionality.garyaustin
05/24/2023, 2:44 PMhappenator
05/24/2023, 2:57 PMdocker compose up
. My next confusion is which DB to use -- the one defined in that repo, or connecting it to my existing local DB? The former doesn't seem to be working (getting a failure due to missing postgres
role) and for the latter, I'm unsure of the correct values for API_JWT_SECRET
and SECRET_KEY_BASE
.happenator
05/24/2023, 2:57 PMgaryaustin
05/24/2023, 3:03 PM