@explorins/pers-signer 1.0.32 → 1.0.33

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.
@@ -1779,12 +1779,16 @@ class PersSignerSDK {
1779
1779
  */
1780
1780
  constructor(config) {
1781
1781
  this.config = config;
1782
+ // Safe hostname/origin extraction - window.location may be undefined in React Native
1783
+ const hasWindowLocation = typeof window !== 'undefined' && typeof window.location !== 'undefined';
1784
+ const hostname = hasWindowLocation ? window.location.hostname : 'localhost';
1785
+ const origin = hasWindowLocation ? window.location.origin : undefined;
1782
1786
  setConfigProvider(new WebConfigProvider({
1783
1787
  apiUrl: config.apiUrl || SIGNER_CONFIG.DEFAULT_SIGNER_API_URL,
1784
1788
  relyingParty: {
1785
- id: typeof window !== 'undefined' ? window.location.hostname : 'localhost',
1789
+ id: hostname,
1786
1790
  name: config.relyingPartyName || SIGNER_CONFIG.DEFAULT_RELYING_PARTY_NAME,
1787
- origin: typeof window !== 'undefined' ? window.location.origin : undefined,
1791
+ origin: origin,
1788
1792
  },
1789
1793
  }));
1790
1794
  this.authenticationService = new AuthenticationService(this.config);