@scalemule/nextjs 0.0.15 → 0.0.16

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.
@@ -1794,7 +1794,12 @@ async function getFlagClient(environment) {
1794
1794
  if (pending) return pending;
1795
1795
  const promise = (async () => {
1796
1796
  const client = new server$1.FlagClient({ apiKey, environment, gatewayUrl });
1797
- await client.init();
1797
+ await Promise.race([
1798
+ client.init(),
1799
+ new Promise(
1800
+ (_, reject) => setTimeout(() => reject(new Error("FlagClient init timeout")), 3e3)
1801
+ )
1802
+ ]);
1798
1803
  _clients.set(key, client);
1799
1804
  return client;
1800
1805
  })();
@@ -1792,7 +1792,12 @@ async function getFlagClient(environment) {
1792
1792
  if (pending) return pending;
1793
1793
  const promise = (async () => {
1794
1794
  const client = new FlagClient({ apiKey, environment, gatewayUrl });
1795
- await client.init();
1795
+ await Promise.race([
1796
+ client.init(),
1797
+ new Promise(
1798
+ (_, reject) => setTimeout(() => reject(new Error("FlagClient init timeout")), 3e3)
1799
+ )
1800
+ ]);
1796
1801
  _clients.set(key, client);
1797
1802
  return client;
1798
1803
  })();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scalemule/nextjs",
3
- "version": "0.0.15",
3
+ "version": "0.0.16",
4
4
  "description": "ScaleMule SDK for Next.js applications - authentication, storage, and user management",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -52,7 +52,7 @@
52
52
  "clean": "rm -rf dist"
53
53
  },
54
54
  "dependencies": {
55
- "@scalemule/sdk": "^0.0.14"
55
+ "@scalemule/sdk": "^0.0.15"
56
56
  },
57
57
  "peerDependencies": {
58
58
  "next": ">=14.0.0",