Using Websocket Channel in React

I am working on a project where I have to make an api call to a websocket, and display certain information based on that call. As you can see I have used the subscribe portion of the channel in my call. Now I'm not sure what to do if anything with the 2nd two set of bracket. Do I need to include them my call as well, or do they come along with the subscription? And from which of them would I be using the information I need to display? In other words which one is the information I am recieving?

enter image description here


const ws = new WebSocket("wss://");

  const apiCall = {
      type: "subscribe",
      product_ids: [
      channels: ["level2"]

  ws.onopen = (event) => {

  ws.onmessage = function (event) {
    const json = JSON.parse(;
    console.log(`[message] Data received from server: ${json}`);


How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum