Creating a WebSocket Connection
To create Casambi WebSocket connection you need to pass your API key as a "protocol" to the server. With javascript (ES6) you can do this as in the following code example.
let api_key = "8aSdFG678M8nPL63FNe5fjrey42loASFWg64v29Se23GAm67576werQtyz1";
webSocket = new WebSocket("wss://door.casambi.com/v1/bridge/", api_key);
note
After the WebSocket has been connected an OPEN message must be sent to the server without delay!