Help using Zustand and Pusher on the edge

I am trying to allow users on my Vercel deployed website to subscribe to Pusher messages. I understand that this isn't normally possible due to how the edge works.

From looking at the Zapdos repository I can see that it's possible to use Zustand to maintain a connection to Pusher on an edge deployment.

I've included screenshots of my Zustand store - on the left file I use the pusher store, then I have a useEffect that starts binding events when the room is defined.

This code works correctly locally (and on a railway deployment), so I know it's just an edge issue and nothing else.

Should the binding methods be in the store itself?
image.png
Was this page helpful?