Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@clerk/clerk-react

Package Overview
Dependencies
Maintainers
4
Versions
2486
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@clerk/clerk-react - npm Package Compare versions

Comparing version 1.3.3-staging.0 to 1.3.3-staging.2

2

dist/clerk-react.cjs.development.js

@@ -69,3 +69,3 @@ 'use strict';

var version = "1.3.3-staging.0";
var version = "1.3.3-staging.2";

@@ -72,0 +72,0 @@ var FAILED_TO_LOAD_ERROR = 'Clerk: Failed to load Clerk';

@@ -1,2 +0,2 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,r=require("react"),n=(e=r)&&"object"==typeof e&&"default"in e?e.default:e;function t(){return(t=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e}).apply(this,arguments)}function o(e,r){e.prototype=Object.create(r.prototype),e.prototype.constructor=e,e.__proto__=r}function s(e,r){if(null==e)return{};var n,t,o={},s=Object.keys(e);for(t=0;t<s.length;t++)r.indexOf(n=s[t])>=0||(o[n]=e[n]);return o}function i(){return"undefined"!=typeof window}var l="Clerk: You must wrap your application in a <ClerkProvider> component.",u=function(){function e(e,r,n){var t=this,o=this;void 0===r&&(r={}),this.listeners=[],this.clerkjs=null,this.preopenSignIn=null,this.preopenSignUp=null,this.premountSignInNodes=new Map,this.premountSignUpNodes=new Map,this.premountUserProfileNodes=new Map,this.premountUserButtonNodes=new Map,this._loaded=!1,this.ssrData=null,this.hydrateClerkJS=function(e){try{if(!e)throw new Error("Failed to hydrate latest Clerk JS");return o.clerkjs=e,o.listeners.forEach((function(r){e.addListener(r)})),null!==o.preopenSignIn&&e.openSignIn(o.preopenSignIn),null!==o.preopenSignUp&&e.openSignUp(o.preopenSignUp),o.premountSignInNodes.forEach((function(r,n){e.mountSignIn(n,r)})),o.premountSignUpNodes.forEach((function(r,n){e.mountSignUp(n,r)})),o.premountUserProfileNodes.forEach((function(r,n){e.mountUserProfile(n,r)})),o.premountUserButtonNodes.forEach((function(r,n){e.mountUserButton(n,r)})),o._loaded=!0,Promise.resolve(o.clerkjs)}catch(e){return Promise.reject(e)}},this.setSession=function(e,r){return t.clerkjs?t.clerkjs.setSession(e,r):Promise.reject()},this.openSignIn=function(e){t.clerkjs&&t._loaded?t.clerkjs.openSignIn(e):t.preopenSignIn=e},this.closeSignIn=function(){t.clerkjs&&t._loaded?t.clerkjs.closeSignIn():t.preopenSignIn=null},this.openSignUp=function(e){t.clerkjs&&t._loaded?t.clerkjs.openSignUp(e):t.preopenSignUp=e},this.closeSignUp=function(){t.clerkjs&&t._loaded?t.clerkjs.closeSignUp():t.preopenSignUp=null},this.mountSignIn=function(e,r){t.clerkjs&&t._loaded?t.clerkjs.mountSignIn(e,r):t.premountSignInNodes.set(e,r)},this.unmountSignIn=function(e){t.clerkjs&&t._loaded?t.clerkjs.unmountSignIn(e):t.premountSignInNodes.delete(e)},this.mountSignUp=function(e,r){t.clerkjs&&t._loaded?t.clerkjs.mountSignUp(e,r):t.premountSignUpNodes.set(e,r)},this.unmountSignUp=function(e){t.clerkjs&&t._loaded?t.clerkjs.unmountSignUp(e):t.premountSignUpNodes.delete(e)},this.mountUserProfile=function(e,r){t.clerkjs&&t._loaded?t.clerkjs.mountUserProfile(e,r):t.premountUserProfileNodes.set(e,r)},this.unmountUserProfile=function(e){t.clerkjs&&t._loaded?t.clerkjs.unmountUserProfile(e):t.premountUserProfileNodes.delete(e)},this.mountUserButton=function(e,r){t.clerkjs&&t._loaded?t.clerkjs.mountUserButton(e,r):t.premountUserButtonNodes.set(e,r)},this.unmountUserButton=function(e){t.clerkjs&&t._loaded?t.clerkjs.unmountUserButton(e):t.premountUserButtonNodes.delete(e)},this.addListener=function(e){t.clerkjs?t.clerkjs.addListener(e):t.listeners.push(e)},this.loadFromServer=function(e){"browser"===t.mode&&t.throwError("loadFromServer cannot be called in a browser context."),t.ssrData=JSON.stringify({client:t.client,session:t.session,token:e})},this.frontendApi=e,this.options=r,this.ClerkConstructor=n,this.mode=i()?"browser":"server"}var r,n=e.prototype;return n.loadClerkJS=function(){var e,r,n=this;return this.frontendApi?this.ClerkConstructor?(window.Clerk=new this.ClerkConstructor(this.frontendApi),window.Clerk.load(this.options).then((function(){return n.hydrateClerkJS(window.Clerk)})).catch((function(e){return n.throwError(e.message||e)}))):(e=this.frontendApi,r=this.options.scriptUrl,new Promise((function(n,t){window.Clerk&&n(null),e||t("Clerk: Missing provider");var o=document.createElement("script"),s=function(e,r){if(r)return r;var n=function(e){return e.endsWith(".lclstage.dev")||e.endsWith(".stgstage.dev")||e.endsWith(".clerkstage.dev")}(e)?"staging":parseInt("1.3.3-staging.0".split(".")[0],10);return"https://"+e+"/npm/@clerk/clerk-js@"+n+"/dist/clerk.browser.js"}(e,r);o.setAttribute("data-clerk-frontend-api",e),o.setAttribute("crossorigin","anonymous"),o.async=!0,document.body||t("Clerk: Missing <body> element."),o.addEventListener("load",(function(){return n(o)})),o.addEventListener("error",(function(){return t("Clerk: Failed to load Clerk")})),o.src=s,document.body.appendChild(o)}))).then((function(){if(window.Clerk)return window.Clerk.load(n.options);throw new Error("Failed to download latest Clerk JS")})).then((function(){return n.hydrateClerkJS(window.Clerk)})).catch((function(e){return n.throwError(e.message||e)})):(this.throwError("Clerk: You must add the frontendApi prop to your <ClerkProvider>"),Promise.resolve())},n.throwError=function(e){return console.error(e),Promise.resolve()},(r=[{key:"client",get:function(){return this.clerkjs?this.clerkjs.client:void 0}},{key:"session",get:function(){return this.clerkjs?this.clerkjs.session:void 0}},{key:"user",get:function(){return this.clerkjs?this.clerkjs.user:void 0}},{key:"environment",get:function(){return this.clerkjs?this.clerkjs.environment:void 0}}])&&function(e,r){for(var n=0;n<r.length;n++){var t=r[n];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(e,t.key,t)}}(e.prototype,r),e}(),c=n.createContext(void 0);c.displayName="ClerkContext";var a=function(e){function r(r){var n;(n=e.call(this,r)||this).onClerkEvent=function(e){n.setState({client:e.client,session:e.session,user:e.user})};var t=r.frontendApi,o=void 0===t?"":t,i=r.Clerk,l=s(r,["frontendApi","Clerk"]);return n.clerk=new u(o,l,i),n.state={client:void 0,session:void 0,user:void 0},n}o(r,e);var t=r.prototype;return t.loadClerk=function(){var e=this;this.clerk.loadClerkJS().then((function(){e.setState({client:e.clerk.client,session:e.clerk.session,user:e.clerk.user})}))},t.componentDidMount=function(){this.loadClerk(),this.clerk&&this.clerk.addListener(this.onClerkEvent)},t.defaultInitialUser=function(e){var r=e.sessions.find((function(e){return"active"===e.status}));return r?r.user:null},t.render=function(){var e=this.state.session;return n.createElement(c.Provider,{value:{guaranteedLoaded:!1,guaranteedUser:!1,clerk:this.clerk}},this.clerk instanceof u&&this.clerk.ssrData&&n.createElement("script",{type:"application/json","data-clerk":"SSR",dangerouslySetInnerHTML:{__html:this.clerk.ssrData}}),n.createElement(n.Fragment,{key:e?e.id:"no-usrses"},this.props.children))},r}(n.PureComponent),d=function(e,o){e.displayName=o=o||e.displayName||e.name||"Component";var s=function(o){var s=r.useContext(c);if(s)return s.clerk&&void 0===s.clerk.session?null:s.guaranteedLoaded?n.createElement(e,Object.assign({},o,{clerk:s.clerk})):s.clerk.client?n.createElement(c.Provider,{value:t({},s,{guaranteedLoaded:!0})},n.createElement(e,Object.assign({},o,{clerk:s.clerk}))):null;if(i())throw new Error(l);return null};return s.displayName="withClerk("+o+")",s},p=function(e,o){e.displayName=o=o||e.displayName||e.name||"Component";var s=function(o){var s=r.useContext(c);if(s)return s.guaranteedUser&&s.clerk.session?n.createElement(e,Object.assign({},o,{user:s.clerk.session.user})):s.clerk.client&&s.clerk.session?n.createElement(c.Provider,{value:t({},s,{guaranteedLoaded:!0,guaranteedUser:!0})},n.createElement(e,Object.assign({},o,{user:s.clerk.session.user}))):null;if(i())throw new Error(l);return null};return s.displayName="withUser("+o+")",s},f=function(e){function r(){var r;return(r=e.apply(this,arguments)||this).portalRef=n.createRef(),r}o(r,e);var t=r.prototype;return t.componentDidMount=function(){this.portalRef.current&&this.props.mount(this.portalRef.current,this.props.props)},t.componentWillUnmount=function(){this.portalRef.current&&this.props.unmount(this.portalRef.current)},t.render=function(){return n.createElement("div",{ref:this.portalRef})},r}(n.PureComponent),k=d((function(e){var r=e.clerk,t=s(e,["clerk"]);return n.createElement(f,{mount:r.mountSignIn,unmount:r.unmountSignIn,props:t})}),"SignIn"),h=d((function(e){var r=e.clerk,t=s(e,["clerk"]);return n.createElement(f,{mount:r.mountSignUp,unmount:r.unmountSignUp,props:t})}),"SignUp"),m=d((function(e){var r=e.clerk,t=s(e,["clerk"]);return n.createElement(f,{mount:r.mountUserProfile,unmount:r.unmountUserProfile,props:t})}),"UserProfile"),g=d((function(e){var r=e.clerk,t=s(e,["clerk"]);return n.createElement(f,{mount:r.mountUserButton,unmount:r.unmountUserButton,props:t})}),"UserButton"),v=p((function(e){return n.createElement(n.Fragment,null,e.children)}),"SignedIn"),C=d((function(e){return null===e.clerk.session?n.createElement(n.Fragment,null,e.children):null}),"SignedOut"),S=d((function(e){return n.createElement(n.Fragment,null,e.children)}),"ClerkLoaded");exports.ClerkContext=c,exports.ClerkLoaded=S,exports.ClerkProvider=a,exports.SignIn=k,exports.SignUp=h,exports.SignedIn=v,exports.SignedOut=C,exports.UserButton=g,exports.UserProfile=m,exports.WithClerk=function(e){var r=e.children;return n.createElement(c.Consumer,null,(function(e){if("function"==typeof r){if(e)return e.clerk&&void 0===e.clerk.session?null:e.guaranteedLoaded?r(e.clerk):e.clerk.client?n.createElement(c.Provider,{value:t({},e,{guaranteedLoaded:!0})},r(e.clerk)):null;throw new Error(l)}throw new Error("Clerk: Child of WithClerk must be a function.")}))},exports.WithUser=function(e){var r=e.children;return n.createElement(c.Consumer,null,(function(e){if("function"==typeof r){if(e)return e.guaranteedUser&&e.clerk.session?r(e.clerk.session.user):e.clerk.client&&e.clerk.session?n.createElement(c.Provider,{value:t({},e,{guaranteedLoaded:!0,guaranteedUser:!0})},r(e.clerk.session.user)):null;throw new Error(l)}throw new Error("Clerk: Child of WithClerk must be a function.")}))},exports.useClerk=function(){var e=r.useContext(c);if(e){if(e.guaranteedLoaded)return e.clerk;throw new Error("Clerk: You're calling useClerk() before there's a guarantee the client has been loaded. Call useClerk() from a child of <SignedIn>, <SignedOut>, or <ClerkLoaded>, or use the withClerk() HOC.")}throw new Error(l)},exports.useUser=function(){var e=r.useContext(c);if(e){if(e.guaranteedUser&&e.clerk.session)return e.clerk.session.user;throw new Error("Clerk: You're calling useUser() before there's a guarantee there's an active user. Call useUser() from a child of <SignedIn> or use the withUser() HOC.")}throw new Error(l)},exports.withClerk=d,exports.withUser=p;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,r=require("react"),n=(e=r)&&"object"==typeof e&&"default"in e?e.default:e;function t(){return(t=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e}).apply(this,arguments)}function o(e,r){e.prototype=Object.create(r.prototype),e.prototype.constructor=e,e.__proto__=r}function s(e,r){if(null==e)return{};var n,t,o={},s=Object.keys(e);for(t=0;t<s.length;t++)r.indexOf(n=s[t])>=0||(o[n]=e[n]);return o}function i(){return"undefined"!=typeof window}var l="Clerk: You must wrap your application in a <ClerkProvider> component.",u=function(){function e(e,r,n){var t=this,o=this;void 0===r&&(r={}),this.listeners=[],this.clerkjs=null,this.preopenSignIn=null,this.preopenSignUp=null,this.premountSignInNodes=new Map,this.premountSignUpNodes=new Map,this.premountUserProfileNodes=new Map,this.premountUserButtonNodes=new Map,this._loaded=!1,this.ssrData=null,this.hydrateClerkJS=function(e){try{if(!e)throw new Error("Failed to hydrate latest Clerk JS");return o.clerkjs=e,o.listeners.forEach((function(r){e.addListener(r)})),null!==o.preopenSignIn&&e.openSignIn(o.preopenSignIn),null!==o.preopenSignUp&&e.openSignUp(o.preopenSignUp),o.premountSignInNodes.forEach((function(r,n){e.mountSignIn(n,r)})),o.premountSignUpNodes.forEach((function(r,n){e.mountSignUp(n,r)})),o.premountUserProfileNodes.forEach((function(r,n){e.mountUserProfile(n,r)})),o.premountUserButtonNodes.forEach((function(r,n){e.mountUserButton(n,r)})),o._loaded=!0,Promise.resolve(o.clerkjs)}catch(e){return Promise.reject(e)}},this.setSession=function(e,r){return t.clerkjs?t.clerkjs.setSession(e,r):Promise.reject()},this.openSignIn=function(e){t.clerkjs&&t._loaded?t.clerkjs.openSignIn(e):t.preopenSignIn=e},this.closeSignIn=function(){t.clerkjs&&t._loaded?t.clerkjs.closeSignIn():t.preopenSignIn=null},this.openSignUp=function(e){t.clerkjs&&t._loaded?t.clerkjs.openSignUp(e):t.preopenSignUp=e},this.closeSignUp=function(){t.clerkjs&&t._loaded?t.clerkjs.closeSignUp():t.preopenSignUp=null},this.mountSignIn=function(e,r){t.clerkjs&&t._loaded?t.clerkjs.mountSignIn(e,r):t.premountSignInNodes.set(e,r)},this.unmountSignIn=function(e){t.clerkjs&&t._loaded?t.clerkjs.unmountSignIn(e):t.premountSignInNodes.delete(e)},this.mountSignUp=function(e,r){t.clerkjs&&t._loaded?t.clerkjs.mountSignUp(e,r):t.premountSignUpNodes.set(e,r)},this.unmountSignUp=function(e){t.clerkjs&&t._loaded?t.clerkjs.unmountSignUp(e):t.premountSignUpNodes.delete(e)},this.mountUserProfile=function(e,r){t.clerkjs&&t._loaded?t.clerkjs.mountUserProfile(e,r):t.premountUserProfileNodes.set(e,r)},this.unmountUserProfile=function(e){t.clerkjs&&t._loaded?t.clerkjs.unmountUserProfile(e):t.premountUserProfileNodes.delete(e)},this.mountUserButton=function(e,r){t.clerkjs&&t._loaded?t.clerkjs.mountUserButton(e,r):t.premountUserButtonNodes.set(e,r)},this.unmountUserButton=function(e){t.clerkjs&&t._loaded?t.clerkjs.unmountUserButton(e):t.premountUserButtonNodes.delete(e)},this.addListener=function(e){t.clerkjs?t.clerkjs.addListener(e):t.listeners.push(e)},this.loadFromServer=function(e){"browser"===t.mode&&t.throwError("loadFromServer cannot be called in a browser context."),t.ssrData=JSON.stringify({client:t.client,session:t.session,token:e})},this.frontendApi=e,this.options=r,this.ClerkConstructor=n,this.mode=i()?"browser":"server"}var r,n=e.prototype;return n.loadClerkJS=function(){var e,r,n=this;return this.frontendApi?this.ClerkConstructor?(window.Clerk=new this.ClerkConstructor(this.frontendApi),window.Clerk.load(this.options).then((function(){return n.hydrateClerkJS(window.Clerk)})).catch((function(e){return n.throwError(e.message||e)}))):(e=this.frontendApi,r=this.options.scriptUrl,new Promise((function(n,t){window.Clerk&&n(null),e||t("Clerk: Missing provider");var o=document.createElement("script"),s=function(e,r){if(r)return r;var n=function(e){return e.endsWith(".lclstage.dev")||e.endsWith(".stgstage.dev")||e.endsWith(".clerkstage.dev")}(e)?"staging":parseInt("1.3.3-staging.2".split(".")[0],10);return"https://"+e+"/npm/@clerk/clerk-js@"+n+"/dist/clerk.browser.js"}(e,r);o.setAttribute("data-clerk-frontend-api",e),o.setAttribute("crossorigin","anonymous"),o.async=!0,document.body||t("Clerk: Missing <body> element."),o.addEventListener("load",(function(){return n(o)})),o.addEventListener("error",(function(){return t("Clerk: Failed to load Clerk")})),o.src=s,document.body.appendChild(o)}))).then((function(){if(window.Clerk)return window.Clerk.load(n.options);throw new Error("Failed to download latest Clerk JS")})).then((function(){return n.hydrateClerkJS(window.Clerk)})).catch((function(e){return n.throwError(e.message||e)})):(this.throwError("Clerk: You must add the frontendApi prop to your <ClerkProvider>"),Promise.resolve())},n.throwError=function(e){return console.error(e),Promise.resolve()},(r=[{key:"client",get:function(){return this.clerkjs?this.clerkjs.client:void 0}},{key:"session",get:function(){return this.clerkjs?this.clerkjs.session:void 0}},{key:"user",get:function(){return this.clerkjs?this.clerkjs.user:void 0}},{key:"environment",get:function(){return this.clerkjs?this.clerkjs.environment:void 0}}])&&function(e,r){for(var n=0;n<r.length;n++){var t=r[n];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(e,t.key,t)}}(e.prototype,r),e}(),c=n.createContext(void 0);c.displayName="ClerkContext";var a=function(e){function r(r){var n;(n=e.call(this,r)||this).onClerkEvent=function(e){n.setState({client:e.client,session:e.session,user:e.user})};var t=r.frontendApi,o=void 0===t?"":t,i=r.Clerk,l=s(r,["frontendApi","Clerk"]);return n.clerk=new u(o,l,i),n.state={client:void 0,session:void 0,user:void 0},n}o(r,e);var t=r.prototype;return t.loadClerk=function(){var e=this;this.clerk.loadClerkJS().then((function(){e.setState({client:e.clerk.client,session:e.clerk.session,user:e.clerk.user})}))},t.componentDidMount=function(){this.loadClerk(),this.clerk&&this.clerk.addListener(this.onClerkEvent)},t.defaultInitialUser=function(e){var r=e.sessions.find((function(e){return"active"===e.status}));return r?r.user:null},t.render=function(){var e=this.state.session;return n.createElement(c.Provider,{value:{guaranteedLoaded:!1,guaranteedUser:!1,clerk:this.clerk}},this.clerk instanceof u&&this.clerk.ssrData&&n.createElement("script",{type:"application/json","data-clerk":"SSR",dangerouslySetInnerHTML:{__html:this.clerk.ssrData}}),n.createElement(n.Fragment,{key:e?e.id:"no-usrses"},this.props.children))},r}(n.PureComponent),d=function(e,o){e.displayName=o=o||e.displayName||e.name||"Component";var s=function(o){var s=r.useContext(c);if(s)return s.clerk&&void 0===s.clerk.session?null:s.guaranteedLoaded?n.createElement(e,Object.assign({},o,{clerk:s.clerk})):s.clerk.client?n.createElement(c.Provider,{value:t({},s,{guaranteedLoaded:!0})},n.createElement(e,Object.assign({},o,{clerk:s.clerk}))):null;if(i())throw new Error(l);return null};return s.displayName="withClerk("+o+")",s},p=function(e,o){e.displayName=o=o||e.displayName||e.name||"Component";var s=function(o){var s=r.useContext(c);if(s)return s.guaranteedUser&&s.clerk.session?n.createElement(e,Object.assign({},o,{user:s.clerk.session.user})):s.clerk.client&&s.clerk.session?n.createElement(c.Provider,{value:t({},s,{guaranteedLoaded:!0,guaranteedUser:!0})},n.createElement(e,Object.assign({},o,{user:s.clerk.session.user}))):null;if(i())throw new Error(l);return null};return s.displayName="withUser("+o+")",s},f=function(e){function r(){var r;return(r=e.apply(this,arguments)||this).portalRef=n.createRef(),r}o(r,e);var t=r.prototype;return t.componentDidMount=function(){this.portalRef.current&&this.props.mount(this.portalRef.current,this.props.props)},t.componentWillUnmount=function(){this.portalRef.current&&this.props.unmount(this.portalRef.current)},t.render=function(){return n.createElement("div",{ref:this.portalRef})},r}(n.PureComponent),k=d((function(e){var r=e.clerk,t=s(e,["clerk"]);return n.createElement(f,{mount:r.mountSignIn,unmount:r.unmountSignIn,props:t})}),"SignIn"),h=d((function(e){var r=e.clerk,t=s(e,["clerk"]);return n.createElement(f,{mount:r.mountSignUp,unmount:r.unmountSignUp,props:t})}),"SignUp"),m=d((function(e){var r=e.clerk,t=s(e,["clerk"]);return n.createElement(f,{mount:r.mountUserProfile,unmount:r.unmountUserProfile,props:t})}),"UserProfile"),g=d((function(e){var r=e.clerk,t=s(e,["clerk"]);return n.createElement(f,{mount:r.mountUserButton,unmount:r.unmountUserButton,props:t})}),"UserButton"),v=p((function(e){return n.createElement(n.Fragment,null,e.children)}),"SignedIn"),C=d((function(e){return null===e.clerk.session?n.createElement(n.Fragment,null,e.children):null}),"SignedOut"),S=d((function(e){return n.createElement(n.Fragment,null,e.children)}),"ClerkLoaded");exports.ClerkContext=c,exports.ClerkLoaded=S,exports.ClerkProvider=a,exports.SignIn=k,exports.SignUp=h,exports.SignedIn=v,exports.SignedOut=C,exports.UserButton=g,exports.UserProfile=m,exports.WithClerk=function(e){var r=e.children;return n.createElement(c.Consumer,null,(function(e){if("function"==typeof r){if(e)return e.clerk&&void 0===e.clerk.session?null:e.guaranteedLoaded?r(e.clerk):e.clerk.client?n.createElement(c.Provider,{value:t({},e,{guaranteedLoaded:!0})},r(e.clerk)):null;throw new Error(l)}throw new Error("Clerk: Child of WithClerk must be a function.")}))},exports.WithUser=function(e){var r=e.children;return n.createElement(c.Consumer,null,(function(e){if("function"==typeof r){if(e)return e.guaranteedUser&&e.clerk.session?r(e.clerk.session.user):e.clerk.client&&e.clerk.session?n.createElement(c.Provider,{value:t({},e,{guaranteedLoaded:!0,guaranteedUser:!0})},r(e.clerk.session.user)):null;throw new Error(l)}throw new Error("Clerk: Child of WithClerk must be a function.")}))},exports.useClerk=function(){var e=r.useContext(c);if(e){if(e.guaranteedLoaded)return e.clerk;throw new Error("Clerk: You're calling useClerk() before there's a guarantee the client has been loaded. Call useClerk() from a child of <SignedIn>, <SignedOut>, or <ClerkLoaded>, or use the withClerk() HOC.")}throw new Error(l)},exports.useUser=function(){var e=r.useContext(c);if(e){if(e.guaranteedUser&&e.clerk.session)return e.clerk.session.user;throw new Error("Clerk: You're calling useUser() before there's a guarantee there's an active user. Call useUser() from a child of <SignedIn> or use the withUser() HOC.")}throw new Error(l)},exports.withClerk=d,exports.withUser=p;
//# sourceMappingURL=clerk-react.cjs.production.min.js.map

@@ -62,3 +62,3 @@ import React, { useContext } from 'react';

var version = "1.3.3-staging.0";
var version = "1.3.3-staging.2";

@@ -65,0 +65,0 @@ var FAILED_TO_LOAD_ERROR = 'Clerk: Failed to load Clerk';

@@ -123,4 +123,4 @@ declare global {

}
export declare type SignInIdentifier = 'username' | 'email_address' | 'phone_number' | 'oauth_google';
export declare type SignInStrategyName = 'password' | 'oauth_google' | 'phone_code' | 'email_code';
export declare type SignInIdentifier = 'username' | 'email_address' | 'phone_number' | 'oauth_google' | 'oauth_facebook';
export declare type SignInStrategyName = 'password' | 'oauth_google' | 'oauth_facebook' | 'phone_code' | 'email_code';
export declare type SignInStatus = 'needs_identifier' | 'needs_factor_one' | 'needs_factor_two' | 'complete';

@@ -160,3 +160,3 @@ export declare type PreferredSignInStrategy = 'password' | 'otp';

export declare type SignUpStatus = 'missing_requirements' | 'complete' | 'abondoned';
export declare type SignUpIdentificationRequirements = Array<Array<'email_address' | 'phone_number' | 'username' | 'oauth_google'>>;
export declare type SignUpIdentificationRequirements = Array<Array<'email_address' | 'phone_number' | 'username' | 'oauth_google' | 'oauth_facebook'>>;
export declare type SignUpAttibuteRequirements = Array<Array<'name_title' | 'name_middle' | 'name_last' | 'name_suffix' | 'age' | 'gender'>>;

@@ -207,3 +207,3 @@ export interface SignUpAttemptResource extends ClerkResource {

phoneNumbers: PhoneNumberResource[];
externalAccounts: GoogleAccountResource[];
externalAccounts: ExternalAccountResource[];
passwordEnabled: boolean;

@@ -242,10 +242,12 @@ publicMetadata: Record<string, unknown>;

}
export interface GoogleAccountResource {
export interface ExternalAccountResource {
id: string;
googleId: string;
provider: string;
externalId: string;
emailAddress: string;
approvedScopes: string;
emailAddress: string;
givenName: string;
familyName: string;
firstName: string;
lastName: string;
picture: string;
providerTitle: () => string;
}

@@ -315,2 +317,3 @@ export interface SessionResource extends ClerkResource {

username: OffOn;
facebookOauthConfigId: string;
googleOauthConfigId: string;

@@ -317,0 +320,0 @@ password: string;

{
"name": "@clerk/clerk-react",
"version": "1.3.3-staging.0",
"version": "1.3.3-staging.2",
"license": "MIT",

@@ -5,0 +5,0 @@ "description": "Clerk.dev React library",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc