@bluecopa/core 0.1.9 → 0.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -4830,15 +4830,24 @@ class CentrifugoWebsocket {
4830
4830
  if (!this.accessToken) {
4831
4831
  throw new Error("Unable to connect to websocket, missing info");
4832
4832
  }
4833
- if (!this.connectionUrl) {
4834
- throw new Error("Unable to connect to websocket, missing url");
4835
- }
4836
4833
  if (!this.centrifuge) {
4837
- this.centrifuge = new Centrifuge(this.connectionUrl, {
4838
- token: this.accessToken
4839
- });
4834
+ const token = atob(this.accessToken);
4835
+ this.centrifuge = new Centrifuge(
4836
+ [
4837
+ {
4838
+ transport: "websocket",
4839
+ endpoint: this.connectionUrl
4840
+ }
4841
+ ],
4842
+ {
4843
+ token
4844
+ }
4845
+ );
4840
4846
  this.centrifuge.on("connecting", () => {
4841
- console.log("Connecting to centrifuge", this.connectionUrl);
4847
+ console.log(
4848
+ "Connecting to centrifuge",
4849
+ this.connectionUrl
4850
+ );
4842
4851
  });
4843
4852
  this.centrifuge.on("error", (err) => {
4844
4853
  console.error("Error connecting to centrifuge", err);