Skip to content

Commit

Permalink
chg: [docs] typos, links to examples
Browse files Browse the repository at this point in the history
  • Loading branch information
gallypette committed Feb 13, 2024
1 parent efded7f commit 46725e7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ await channel.send("your_handler", "this is my payload", ref)
channel.off(None, ref, callback1)
```

## Examples
see `usage.py`, `sending-receiving-usage.py`, and `fd-usage.py`.

## Sample usage with Supabase

Here's how you could connect to your realtime endpoint using Supabase endpoint. Should be correct as of 13th Feb 2024. Please replace `SUPABASE_ID` and `API_KEY` with your own `SUPABASE_ID` and `API_KEY`. The variables shown below are fake and they will not work if you try to run the snippet.
Expand Down
9 changes: 3 additions & 6 deletions sending-receiving-usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@ def callback2(payload):
async def main():

# your phoenix server token
# TOKEN = ""
TOKEN = "SFMyNTY.g2gDYRRuBgBK_9yHjQFiAAFRgA.Fs-vgUBiBiSBtKq9qlKar8ny7SjO0ykXfaLUk2a1TMM"
TOKEN = ""
# your phoenix server URL
# URL = f"ws://127.0.0.1:4000/socket/websocket?token={TOKEN}&vsn=2.0.0"
URL = f"ws://127.0.0.1:4000/feedsocket/websocket?token={TOKEN}&vsn=2.0.0"
URL = f"ws://127.0.0.1:4000/socket/websocket?token={TOKEN}&vsn=2.0.0"

client = Socket(URL)

Expand All @@ -26,8 +24,7 @@ async def main():
listen_task = asyncio.ensure_future(client.listen())

# join the channel
# channel = client.set_channel("this:is:my:topic")
channel = client.set_channel("feed:44")
channel = client.set_channel("this:is:my:topic")
await channel.join()

channel.on("test_event", None, callback1)
Expand Down

0 comments on commit 46725e7

Please sign in to comment.