How to make RT API connection (websocket)

This is socket io on client side… I cannot make a connection on server side with this following code :

const uri = 'wss://online-go.com/socket.io/?transport=websocket'
const socket = io(uri)

So I used the ‘ws’ package and here I have this response :

0{"sid":"CzCoBj9mqs72mLiQBEtU","upgrades":[],"pingInterval":25000,"pingTimeout":5000}

From this topic (OGS API notes) the author say :

  • The client also sends an authenticate RT API call. This is necessary for the client to send game moves later on. The call is sent as 42[“authenticate”,{“player_id”:“your_id_here”,“username”:“your_username_here”,“auth”:“your_chat_auth”}]

You could see from above that I tried to follow thoses instructions without success.

const data = `42["authenticate",{"player_id":"${player_id}", "username": "${username}", "auth": "${auth}", "jwt": "${jwt}"}]`
ws.send(data)

I think my message don’t have the right structure and I need your expertise for this.