@air-jam/sdk 0.1.3 → 0.1.4

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.js CHANGED
@@ -218,7 +218,6 @@ var SocketManager = class {
218
218
  }
219
219
  const socket = io(this.serverUrl, {
220
220
  autoConnect: false,
221
- transports: ["websocket"],
222
221
  query: { role }
223
222
  });
224
223
  this.sockets[role] = socket;
@@ -305,6 +304,17 @@ var getEnvApiKey = () => {
305
304
  }
306
305
  return void 0;
307
306
  };
307
+ var getEnvPublicHost = () => {
308
+ const viteEnv = getViteEnv();
309
+ if (viteEnv?.VITE_AIR_JAM_PUBLIC_HOST) {
310
+ return viteEnv.VITE_AIR_JAM_PUBLIC_HOST;
311
+ }
312
+ if (typeof process !== "undefined" && process.env) {
313
+ const nextHost = process.env.NEXT_PUBLIC_AIR_JAM_PUBLIC_HOST;
314
+ if (nextHost) return nextHost;
315
+ }
316
+ return void 0;
317
+ };
308
318
  var AirJamProvider = ({
309
319
  children,
310
320
  serverUrl,
@@ -318,7 +328,7 @@ var AirJamProvider = ({
318
328
  serverUrl: serverUrl ?? getEnvServerUrl(),
319
329
  apiKey: apiKey ?? getEnvApiKey(),
320
330
  maxPlayers,
321
- publicHost
331
+ publicHost: publicHost ?? getEnvPublicHost()
322
332
  }),
323
333
  [serverUrl, apiKey, maxPlayers, publicHost]
324
334
  );