@invonetwork/web-sdk 3.28.0 → 3.29.1

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/server.cjs CHANGED
@@ -1593,7 +1593,7 @@ function toPhoneChangeRequest(raw) {
1593
1593
  }
1594
1594
 
1595
1595
  // src/version.ts
1596
- var SDK_VERSION = "3.28.0";
1596
+ var SDK_VERSION = "3.29.1";
1597
1597
 
1598
1598
  // src/payouts.ts
1599
1599
  var AMOUNT = /^\d+(\.\d{1,2})?$/;
@@ -1993,7 +1993,21 @@ function resolveEnvironment(gameSecret, opts = {}) {
1993
1993
  if (hit) return hit;
1994
1994
  const fetchImpl = opts.fetch ?? ((input, init) => fetch(input, init));
1995
1995
  const p = (async () => {
1996
- const env = await ask(PRODUCTION_BASE_URL, gameSecret, fetchImpl) ?? await ask(SANDBOX_BASE_URL, gameSecret, fetchImpl);
1996
+ let prodError = null;
1997
+ let env = null;
1998
+ try {
1999
+ env = await ask(PRODUCTION_BASE_URL, gameSecret, fetchImpl);
2000
+ } catch (err) {
2001
+ prodError = err;
2002
+ }
2003
+ if (!env) {
2004
+ try {
2005
+ env = await ask(SANDBOX_BASE_URL, gameSecret, fetchImpl);
2006
+ } catch (err) {
2007
+ throw prodError ?? err;
2008
+ }
2009
+ }
2010
+ if (!env && prodError) throw prodError;
1997
2011
  if (!env) {
1998
2012
  throw new EnvironmentUnknownError(
1999
2013
  "Neither INVO production nor the INVO sandbox recognises this key. Check INVO_GAME_SECRET in your secrets."