@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.cjs CHANGED
@@ -246,7 +246,6 @@ var SocketManager = class {
246
246
  }
247
247
  const socket = socket_ioClient.io(this.serverUrl, {
248
248
  autoConnect: false,
249
- transports: ["websocket"],
250
249
  query: { role }
251
250
  });
252
251
  this.sockets[role] = socket;
@@ -333,6 +332,17 @@ var getEnvApiKey = () => {
333
332
  }
334
333
  return void 0;
335
334
  };
335
+ var getEnvPublicHost = () => {
336
+ const viteEnv = getViteEnv();
337
+ if (viteEnv?.VITE_AIR_JAM_PUBLIC_HOST) {
338
+ return viteEnv.VITE_AIR_JAM_PUBLIC_HOST;
339
+ }
340
+ if (typeof process !== "undefined" && process.env) {
341
+ const nextHost = process.env.NEXT_PUBLIC_AIR_JAM_PUBLIC_HOST;
342
+ if (nextHost) return nextHost;
343
+ }
344
+ return void 0;
345
+ };
336
346
  var AirJamProvider = ({
337
347
  children,
338
348
  serverUrl,
@@ -346,7 +356,7 @@ var AirJamProvider = ({
346
356
  serverUrl: serverUrl ?? getEnvServerUrl(),
347
357
  apiKey: apiKey ?? getEnvApiKey(),
348
358
  maxPlayers,
349
- publicHost
359
+ publicHost: publicHost ?? getEnvPublicHost()
350
360
  }),
351
361
  [serverUrl, apiKey, maxPlayers, publicHost]
352
362
  );