@privy-io/react-auth 2.4.1 → 2.4.2

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.
@@ -1 +1 @@
1
- "use strict";exports.CHAIN_ID_MAINNET=1,exports.CLIENT_ANALYTICS_ID_KEY="privy:caid",exports.CODE_VERIFIER_KEY="privy:code_verifier",exports.CONNECTIONS_HISTORY_KEY="privy:connections",exports.CONNECTORS_STATE_KEY="privy:connectors",exports.CUSTOMER_ACCESS_TOKEN_COOKIE_KEY="privy-token",exports.CUSTOMER_ACCESS_TOKEN_STORAGE_KEY="privy:token",exports.DEFAULT_API_TIMEOUT_MS=2e4,exports.DEFAULT_NETWORK="0x1",exports.DEFAULT_PRIVY_API_URL="https://auth.privy.io",exports.DEFAULT_RPC_TIMEOUT=12e4,exports.DEFAULT_SUCCESS_SCREEN_DURATION_MS=1400,exports.DEFAULT_SUCCESS_SCREEN_EXTRA_LONG_DURATION_MS=4e3,exports.DEFAULT_SUCCESS_SCREEN_LONG_DURATION_MS=2500,exports.DEPRECATED_REFRESH_TOKEN="deprecated",exports.FORKED_TOKEN_STORAGE_KEY="privy:session_transfer_token",exports.HEADLESS_OAUTH_KEY="privy:headless_oauth",exports.IDENTITY_TOKEN_COOKIE_KEY="privy-id-token",exports.IDENTITY_TOKEN_STORAGE_KEY="privy:id_token",exports.JWT_ALGORITHM="ES256",exports.JWT_ISSUER="privy.io",exports.MOONPAY_API_URL="https://api.moonpay.com/v1",exports.MOONPAY_API_URL_SANDBOX="https://api.moonpay.com/v1",exports.MOONPAY_PUBLIC_KEY="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",exports.MOONPAY_PUBLIC_KEY_SANDBOX="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",exports.OAUTH_DISABLE_SIGNUP_KEY="privy:oauth_disable_signup",exports.OPTIMISM_STACK_GAS_PRICE_ORACLE_ABI=["function getL1Fee(bytes memory _data) external view returns (uint256)"],exports.OPTIMISM_STACK_GAS_PRICE_ORACLE_ADDRESS="0x420000000000000000000000000000000000000F",exports.PRIVY_ACCESS_TOKEN_STORAGE_KEY="privy:pat",exports.PRIVY_WALLETCONNECT_CLOUD_ID="34357d3c125c2bcf2ce2bc3309d98715",exports.PRIVY_WALLET_KEY_PREFIX="privy:wallet",exports.REFRESH_TOKEN_COOKIE_KEY="privy-refresh-token",exports.REFRESH_TOKEN_STORAGE_KEY="privy:refresh_token",exports.SESSION_COOKIE_KEY="privy-session",exports.STATE_CODE_KEY="privy:state_code",exports.VERSION="2.4.1",exports.WALLET_CONNECT_INFURA_POLLING_INTERVAL=3e4,exports.WALLET_CONNECT_STORAGE_KEY="walletconnect",exports.WALLET_PROXY_TIMEOUT=3e4,exports.getGuestCredentialStorageKey=_=>`privy:guest:${_}`,exports.getPrivyWalletKey=_=>`privy:wallet:${_}`,exports.getProviderAccessTokenStorageKey=_=>`privy:cross-app:${_}`;
1
+ "use strict";exports.CHAIN_ID_MAINNET=1,exports.CLIENT_ANALYTICS_ID_KEY="privy:caid",exports.CODE_VERIFIER_KEY="privy:code_verifier",exports.CONNECTIONS_HISTORY_KEY="privy:connections",exports.CONNECTORS_STATE_KEY="privy:connectors",exports.CUSTOMER_ACCESS_TOKEN_COOKIE_KEY="privy-token",exports.CUSTOMER_ACCESS_TOKEN_STORAGE_KEY="privy:token",exports.DEFAULT_API_TIMEOUT_MS=2e4,exports.DEFAULT_NETWORK="0x1",exports.DEFAULT_PRIVY_API_URL="https://auth.privy.io",exports.DEFAULT_RPC_TIMEOUT=12e4,exports.DEFAULT_SUCCESS_SCREEN_DURATION_MS=1400,exports.DEFAULT_SUCCESS_SCREEN_EXTRA_LONG_DURATION_MS=4e3,exports.DEFAULT_SUCCESS_SCREEN_LONG_DURATION_MS=2500,exports.DEPRECATED_REFRESH_TOKEN="deprecated",exports.FORKED_TOKEN_STORAGE_KEY="privy:session_transfer_token",exports.HEADLESS_OAUTH_KEY="privy:headless_oauth",exports.IDENTITY_TOKEN_COOKIE_KEY="privy-id-token",exports.IDENTITY_TOKEN_STORAGE_KEY="privy:id_token",exports.JWT_ALGORITHM="ES256",exports.JWT_ISSUER="privy.io",exports.MOONPAY_API_URL="https://api.moonpay.com/v1",exports.MOONPAY_API_URL_SANDBOX="https://api.moonpay.com/v1",exports.MOONPAY_PUBLIC_KEY="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",exports.MOONPAY_PUBLIC_KEY_SANDBOX="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",exports.OAUTH_DISABLE_SIGNUP_KEY="privy:oauth_disable_signup",exports.OPTIMISM_STACK_GAS_PRICE_ORACLE_ABI=["function getL1Fee(bytes memory _data) external view returns (uint256)"],exports.OPTIMISM_STACK_GAS_PRICE_ORACLE_ADDRESS="0x420000000000000000000000000000000000000F",exports.PRIVY_ACCESS_TOKEN_STORAGE_KEY="privy:pat",exports.PRIVY_WALLETCONNECT_CLOUD_ID="34357d3c125c2bcf2ce2bc3309d98715",exports.PRIVY_WALLET_KEY_PREFIX="privy:wallet",exports.REFRESH_TOKEN_COOKIE_KEY="privy-refresh-token",exports.REFRESH_TOKEN_STORAGE_KEY="privy:refresh_token",exports.SESSION_COOKIE_KEY="privy-session",exports.STATE_CODE_KEY="privy:state_code",exports.VERSION="2.4.2",exports.WALLET_CONNECT_INFURA_POLLING_INTERVAL=3e4,exports.WALLET_CONNECT_STORAGE_KEY="walletconnect",exports.WALLET_PROXY_TIMEOUT=3e4,exports.getGuestCredentialStorageKey=_=>`privy:guest:${_}`,exports.getPrivyWalletKey=_=>`privy:wallet:${_}`,exports.getProviderAccessTokenStorageKey=_=>`privy:cross-app:${_}`;
package/dist/cjs/http.js CHANGED
@@ -1 +1 @@
1
- "use strict";var t=require("ofetch"),e=require("./constants.js"),r=require("./errors.js"),s=require("./paths.js");let i=[s.sessionsRefreshPath,s.recoverForkedSessionsPath,s.sessionsLogoutPath,s.analyticsEventsPath];exports.Http=class{async get(t,e){try{return await this.baseFetch(t,e)}catch(t){throw r.formatApiError(t)}}async post(t,e,s){try{return await this.baseFetch(t,{method:"POST",...e?{body:e}:{},...s})}catch(t){throw r.formatApiError(t)}}async delete(t,e){try{return await this.baseFetch(t,{method:"DELETE",...e})}catch(t){throw r.formatApiError(t)}}constructor({appId:s,appClientId:a,client:o,defaults:n}){this.appId=s,this.appClientId=a,this.clientAnalyticsId=o.clientAnalyticsId,this.sdkVersion=e.VERSION,this.client=o,this.defaults=n,this.fallbackApiUrl=o.fallbackApiUrl,this.baseFetch=t.ofetch.create({baseURL:this.defaults.baseURL,timeout:this.defaults.timeout,retry:3,retryDelay:500,retryStatusCodes:[408,409,425,500,502,503,504],credentials:"include",onRequest:async({request:t,options:e})=>{let r=new Headers(e.headers);r.set("privy-app-id",this.appId),this.appClientId&&r.set("privy-client-id",this.appClientId),r.set("privy-ca-id",this.clientAnalyticsId||""),r.set("privy-client",`react-auth:${this.sdkVersion}`);let s=i.includes(t.toString());if(!r.has("authorization")){let t=await this.client.getAccessToken({disableAutoRefresh:s});null!==t&&r.set("authorization",`Bearer ${t}`)}e.headers=r,e.retryDelay&&(e.retryDelay=3*e.retryDelay)},onRequestError:({error:t})=>{if(t instanceof DOMException&&"AbortError"===t.name)throw new r.PrivyTimeoutError}})}};
1
+ "use strict";var t=require("ofetch"),e=require("./constants.js"),r=require("./errors.js"),s=require("./paths.js");let i=[s.sessionsRefreshPath,s.recoverForkedSessionsPath,s.sessionsLogoutPath,s.analyticsEventsPath];exports.Http=class{async get(t,e){try{return await this.baseFetch(t,e)}catch(t){throw r.formatApiError(t)}}async post(t,e,s){try{return await this.baseFetch(t,{method:"POST",...e?{body:e}:{},...s})}catch(t){throw r.formatApiError(t)}}async delete(t,e){try{return await this.baseFetch(t,{method:"DELETE",...e})}catch(t){throw r.formatApiError(t)}}constructor({appId:s,appClientId:a,client:o,defaults:n}){this.appId=s,this.appClientId=a,this.clientAnalyticsId=o.clientAnalyticsId,this.sdkVersion=e.VERSION,this.client=o,this.defaults=n,this.fallbackApiUrl=o.fallbackApiUrl,this.baseFetch=t.ofetch.create({baseURL:this.defaults.baseURL,timeout:this.defaults.timeout,retry:3,retryDelay:500,retryStatusCodes:[408,409,425,500,502,503,504],credentials:"include",onRequest:async({request:t,options:e})=>{let r=new Headers(e.headers);r.set("privy-app-id",this.appId),this.appClientId&&r.set("privy-client-id",this.appClientId),r.set("privy-ca-id",this.clientAnalyticsId||""),r.set("privy-client",`react-auth:${this.sdkVersion}`);let s=i.includes(t.toString());if(!r.has("authorization")){let t=await this.client.getAccessToken({disableAutoRefresh:s});null!==t&&r.set("authorization",`Bearer ${t}`)}e.headers=r,e.retryDelay&&"number"==typeof e.retryDelay&&(e.retryDelay=3*e.retryDelay)},onRequestError:({error:t})=>{if(t instanceof DOMException&&"AbortError"===t.name)throw new r.PrivyTimeoutError}})}};
@@ -1 +1 @@
1
- const e="34357d3c125c2bcf2ce2bc3309d98715",i="https://auth.privy.io",r=2e4,t=1400,p=2500,o=4e3,v="2.4.1",s="ES256",n="privy.io",y="privy:token",c="privy-token",a="privy:refresh_token",_="privy-refresh-token",d="privy:pat",l="privy:id_token",h="privy-id-token",k="privy-session",f="privy:session_transfer_token",u="privy:wallet",b="privy:caid",m=e=>`privy:guest:${e}`,w=e=>`privy:cross-app:${e}`,j="privy:state_code",x="privy:code_verifier",F="privy:headless_oauth",g="privy:oauth_disable_signup",L=e=>`privy:wallet:${e}`,S="privy:connectors",$="privy:connections",q="walletconnect",H=3e4,J=12e4,X=1,z="0x1",C=3e4,E="https://api.moonpay.com/v1",I="https://api.moonpay.com/v1",M="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",R="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",U="0x420000000000000000000000000000000000000F",V=["function getL1Fee(bytes memory _data) external view returns (uint256)"],W="deprecated";export{X as CHAIN_ID_MAINNET,b as CLIENT_ANALYTICS_ID_KEY,x as CODE_VERIFIER_KEY,$ as CONNECTIONS_HISTORY_KEY,S as CONNECTORS_STATE_KEY,c as CUSTOMER_ACCESS_TOKEN_COOKIE_KEY,y as CUSTOMER_ACCESS_TOKEN_STORAGE_KEY,r as DEFAULT_API_TIMEOUT_MS,z as DEFAULT_NETWORK,i as DEFAULT_PRIVY_API_URL,J as DEFAULT_RPC_TIMEOUT,t as DEFAULT_SUCCESS_SCREEN_DURATION_MS,o as DEFAULT_SUCCESS_SCREEN_EXTRA_LONG_DURATION_MS,p as DEFAULT_SUCCESS_SCREEN_LONG_DURATION_MS,W as DEPRECATED_REFRESH_TOKEN,f as FORKED_TOKEN_STORAGE_KEY,F as HEADLESS_OAUTH_KEY,h as IDENTITY_TOKEN_COOKIE_KEY,l as IDENTITY_TOKEN_STORAGE_KEY,s as JWT_ALGORITHM,n as JWT_ISSUER,E as MOONPAY_API_URL,I as MOONPAY_API_URL_SANDBOX,M as MOONPAY_PUBLIC_KEY,R as MOONPAY_PUBLIC_KEY_SANDBOX,g as OAUTH_DISABLE_SIGNUP_KEY,V as OPTIMISM_STACK_GAS_PRICE_ORACLE_ABI,U as OPTIMISM_STACK_GAS_PRICE_ORACLE_ADDRESS,d as PRIVY_ACCESS_TOKEN_STORAGE_KEY,e as PRIVY_WALLETCONNECT_CLOUD_ID,u as PRIVY_WALLET_KEY_PREFIX,_ as REFRESH_TOKEN_COOKIE_KEY,a as REFRESH_TOKEN_STORAGE_KEY,k as SESSION_COOKIE_KEY,j as STATE_CODE_KEY,v as VERSION,H as WALLET_CONNECT_INFURA_POLLING_INTERVAL,q as WALLET_CONNECT_STORAGE_KEY,C as WALLET_PROXY_TIMEOUT,m as getGuestCredentialStorageKey,L as getPrivyWalletKey,w as getProviderAccessTokenStorageKey};
1
+ const e="34357d3c125c2bcf2ce2bc3309d98715",i="https://auth.privy.io",r=2e4,t=1400,p=2500,o=4e3,v="2.4.2",s="ES256",n="privy.io",y="privy:token",c="privy-token",a="privy:refresh_token",_="privy-refresh-token",d="privy:pat",l="privy:id_token",h="privy-id-token",k="privy-session",f="privy:session_transfer_token",u="privy:wallet",b="privy:caid",m=e=>`privy:guest:${e}`,w=e=>`privy:cross-app:${e}`,j="privy:state_code",x="privy:code_verifier",F="privy:headless_oauth",g="privy:oauth_disable_signup",L=e=>`privy:wallet:${e}`,S="privy:connectors",$="privy:connections",q="walletconnect",H=3e4,J=12e4,X=1,z="0x1",C=3e4,E="https://api.moonpay.com/v1",I="https://api.moonpay.com/v1",M="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",R="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",U="0x420000000000000000000000000000000000000F",V=["function getL1Fee(bytes memory _data) external view returns (uint256)"],W="deprecated";export{X as CHAIN_ID_MAINNET,b as CLIENT_ANALYTICS_ID_KEY,x as CODE_VERIFIER_KEY,$ as CONNECTIONS_HISTORY_KEY,S as CONNECTORS_STATE_KEY,c as CUSTOMER_ACCESS_TOKEN_COOKIE_KEY,y as CUSTOMER_ACCESS_TOKEN_STORAGE_KEY,r as DEFAULT_API_TIMEOUT_MS,z as DEFAULT_NETWORK,i as DEFAULT_PRIVY_API_URL,J as DEFAULT_RPC_TIMEOUT,t as DEFAULT_SUCCESS_SCREEN_DURATION_MS,o as DEFAULT_SUCCESS_SCREEN_EXTRA_LONG_DURATION_MS,p as DEFAULT_SUCCESS_SCREEN_LONG_DURATION_MS,W as DEPRECATED_REFRESH_TOKEN,f as FORKED_TOKEN_STORAGE_KEY,F as HEADLESS_OAUTH_KEY,h as IDENTITY_TOKEN_COOKIE_KEY,l as IDENTITY_TOKEN_STORAGE_KEY,s as JWT_ALGORITHM,n as JWT_ISSUER,E as MOONPAY_API_URL,I as MOONPAY_API_URL_SANDBOX,M as MOONPAY_PUBLIC_KEY,R as MOONPAY_PUBLIC_KEY_SANDBOX,g as OAUTH_DISABLE_SIGNUP_KEY,V as OPTIMISM_STACK_GAS_PRICE_ORACLE_ABI,U as OPTIMISM_STACK_GAS_PRICE_ORACLE_ADDRESS,d as PRIVY_ACCESS_TOKEN_STORAGE_KEY,e as PRIVY_WALLETCONNECT_CLOUD_ID,u as PRIVY_WALLET_KEY_PREFIX,_ as REFRESH_TOKEN_COOKIE_KEY,a as REFRESH_TOKEN_STORAGE_KEY,k as SESSION_COOKIE_KEY,j as STATE_CODE_KEY,v as VERSION,H as WALLET_CONNECT_INFURA_POLLING_INTERVAL,q as WALLET_CONNECT_STORAGE_KEY,C as WALLET_PROXY_TIMEOUT,m as getGuestCredentialStorageKey,L as getPrivyWalletKey,w as getProviderAccessTokenStorageKey};
package/dist/esm/http.mjs CHANGED
@@ -1 +1 @@
1
- import{ofetch as t}from"ofetch";import{VERSION as e}from"./constants.mjs";import{formatApiError as s,PrivyTimeoutError as r}from"./errors.mjs";import{sessionsRefreshPath as i,recoverForkedSessionsPath as a,sessionsLogoutPath as n,analyticsEventsPath as o}from"./paths.mjs";let c=[i,a,n,o];class h{async get(t,e){try{return await this.baseFetch(t,e)}catch(t){throw s(t)}}async post(t,e,r){try{return await this.baseFetch(t,{method:"POST",...e?{body:e}:{},...r})}catch(t){throw s(t)}}async delete(t,e){try{return await this.baseFetch(t,{method:"DELETE",...e})}catch(t){throw s(t)}}constructor({appId:s,appClientId:i,client:a,defaults:n}){this.appId=s,this.appClientId=i,this.clientAnalyticsId=a.clientAnalyticsId,this.sdkVersion=e,this.client=a,this.defaults=n,this.fallbackApiUrl=a.fallbackApiUrl,this.baseFetch=t.create({baseURL:this.defaults.baseURL,timeout:this.defaults.timeout,retry:3,retryDelay:500,retryStatusCodes:[408,409,425,500,502,503,504],credentials:"include",onRequest:async({request:t,options:e})=>{let s=new Headers(e.headers);s.set("privy-app-id",this.appId),this.appClientId&&s.set("privy-client-id",this.appClientId),s.set("privy-ca-id",this.clientAnalyticsId||""),s.set("privy-client",`react-auth:${this.sdkVersion}`);let r=c.includes(t.toString());if(!s.has("authorization")){let t=await this.client.getAccessToken({disableAutoRefresh:r});null!==t&&s.set("authorization",`Bearer ${t}`)}e.headers=s,e.retryDelay&&(e.retryDelay=3*e.retryDelay)},onRequestError:({error:t})=>{if(t instanceof DOMException&&"AbortError"===t.name)throw new r}})}}export{h as Http};
1
+ import{ofetch as t}from"ofetch";import{VERSION as e}from"./constants.mjs";import{formatApiError as r,PrivyTimeoutError as s}from"./errors.mjs";import{sessionsRefreshPath as i,recoverForkedSessionsPath as a,sessionsLogoutPath as n,analyticsEventsPath as o}from"./paths.mjs";let c=[i,a,n,o];class l{async get(t,e){try{return await this.baseFetch(t,e)}catch(t){throw r(t)}}async post(t,e,s){try{return await this.baseFetch(t,{method:"POST",...e?{body:e}:{},...s})}catch(t){throw r(t)}}async delete(t,e){try{return await this.baseFetch(t,{method:"DELETE",...e})}catch(t){throw r(t)}}constructor({appId:r,appClientId:i,client:a,defaults:n}){this.appId=r,this.appClientId=i,this.clientAnalyticsId=a.clientAnalyticsId,this.sdkVersion=e,this.client=a,this.defaults=n,this.fallbackApiUrl=a.fallbackApiUrl,this.baseFetch=t.create({baseURL:this.defaults.baseURL,timeout:this.defaults.timeout,retry:3,retryDelay:500,retryStatusCodes:[408,409,425,500,502,503,504],credentials:"include",onRequest:async({request:t,options:e})=>{let r=new Headers(e.headers);r.set("privy-app-id",this.appId),this.appClientId&&r.set("privy-client-id",this.appClientId),r.set("privy-ca-id",this.clientAnalyticsId||""),r.set("privy-client",`react-auth:${this.sdkVersion}`);let s=c.includes(t.toString());if(!r.has("authorization")){let t=await this.client.getAccessToken({disableAutoRefresh:s});null!==t&&r.set("authorization",`Bearer ${t}`)}e.headers=r,e.retryDelay&&"number"==typeof e.retryDelay&&(e.retryDelay=3*e.retryDelay)},onRequestError:({error:t})=>{if(t instanceof DOMException&&"AbortError"===t.name)throw new s}})}}export{l as Http};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@privy-io/react-auth",
3
- "version": "2.4.1",
3
+ "version": "2.4.2",
4
4
  "description": "React client for the Privy Auth API",
5
5
  "keywords": [
6
6
  "authentication",