I am trying to subscribe to channel using native WebSocket in vanilla javascript. I have the following code:
let ws = new WebSocket('wss://ws-feed.gdax.com');
var params = {
"type": "subscribe",
"channels": [{"name": "ticker", "product_ids": ["BTC-USD"]}]
}
ws.onmessage = function(msg) {
console.log(msg);
}
I am trying to connect to this channel but I am not able to do so