Create connection

var socket = new WebSocket(
  'wss://ws-api-spot.kucoin.com/?token=xxx&[connectId=xxxxx]',
);

When the connection is successfully established, the system will send a welcome message.

TIP

Only when the welcome message is received will the connection be available

{
  "id": "hQvf8jkno",
  "type": "welcome"
}

connectId: the connection id, a unique value taken from the client side. Both the id of the welcome message and the id of the error message are connectId.

If you only want to receive private messages of the specified topic, please set privateChannel to true when subscribing.