Socket.io and Cors error

I am trying to develop a client browser service to use in OBS so that I can make my own tools.
I am attempting to use the websockets to ping for chats and events. However I am unable to get socket.io to work. I have got my client to run in https:// and I am using vite/Reactjs as the node client. I am probably crossing wires here but I’m struggling to find examples in the docs.
When using Socket.io-client. I am unable to get a successful handshake. I am getting a CORS error. Would someone be open to walk me through this?

import { io } from “socket.io-client”;

let socket = io(“wss://eventsub.wss.twitch.tv/ws”);

event sub doesn’t support SocketIO/is not compatible with socketIO

Socket IO is an encapsulation method built on top of web sockets.

That would have been nice to know. Thank for letting me know. Do you have suggestions for what I can use?

EventSub is straight websockets so use a straight websocket client.

this is built into browser not additional libraries required.

An Example: EventSub WebSockets with Implicit Auth Example

Thank you so much for your time and knowledge! I appreciate it/

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.