supabase-community / realtime-py

A Python Client for Phoenix Channels
MIT License
118 stars 47 forks source link

It doesn't work with Supabase #113

Closed junekhan closed 2 months ago

junekhan commented 2 months ago

Bug report

Describe the bug

Receive no changes from Supabase Database.

To Reproduce

  1. Run the following code
SUPABASE_ID = <REDACTED>
API_KEY =  <REDACTED>

def callback1(payload):
    print("Callback 1: ", payload)

if __name__ == "__main__":
    URL = f"wss://{SUPABASE_ID}.supabase.co/realtime/v1/websocket?apikey={API_KEY}&vsn=1.0.0"
    s = Socket(URL)
    s.connect()

    channel_1 = s.set_channel("realtime:*")
    channel_1.join().on('*', callback1)
    s.listen()
  1. Go edit tables on Supabase, add row, update row, etc.
  2. Nothing happens

Expected behavior

See logs in the console

Callback 1: something

Screenshots

image
junekhan commented 2 months ago

Sorry, it was my mistake to subscribe with ANON key. It works now with my service role key.