@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 +12 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +12 -2
- package/dist/index.js.map +1 -1
- package/package.json +10 -7
- package/src/components/host-shell.tsx +0 -1
- package/src/components/player-avatar.tsx +0 -1
- package/src/context/air-jam-context.tsx +21 -1
- package/src/context/socket-manager.ts +0 -1
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
|
);
|