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
2316
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.1.1 to 1.1.2-staging.0

2

dist/clerk-react.cjs.development.js

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

var version = "1.1.1";
var version = "1.1.2-staging.0";

@@ -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){return e||"https://cdn.jsdelivr.net/npm/@clerk/clerk-js@"+parseInt("1.1.1".split(".")[0],10)+"/dist/clerk.browser.js"}(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){return e||"https://cdn.jsdelivr.net/npm/@clerk/clerk-js@"+parseInt("1.1.2-staging.0".split(".")[0],10)+"/dist/clerk.browser.js"}(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.1.1";
var version = "1.1.2-staging.0";

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

@@ -262,20 +262,2 @@ declare global {

export declare type OffOnReq = OffOn | "required";
export interface AuthConfigJSON {
object: "auth_config";
id: string;
first_name: OffOnReq;
last_name: OffOnReq;
email_address: OffOn;
phone_number: OffOn;
username: OffOn;
google_oauth_config_id: string;
slack_oauth_config_id: string;
password: OffOnReq;
identification_strategies: Array<string>;
identification_requirements: Array<Array<string>>;
password_conditions: any;
first_factors: Array<string>;
second_factors: Array<string>;
single_user_session_mode: boolean;
}
export interface LogoImageJSON {

@@ -287,25 +269,42 @@ object: "image";

}
export interface DisplayConfigJSON {
object: "display_config";
export interface AuthConfigResource extends ClerkResource {
id: string;
instance_environment_type: string;
application_name: string;
firstName: OffOnReq;
lastName: OffOnReq;
emailAddress: OffOn;
phoneNumber: OffOn;
username: OffOn;
googleOauthConfigId: string;
slackOauthConfigId: string;
password: string;
identificationStrategies: Array<SignInIdentifier>;
identificationRequirements: Array<Array<SignInIdentifier>>;
passwordConditions: any;
firstFactors: Array<SignInStrategyName>;
secondFactors: Array<SignInStrategyName>;
singleUserSessionMode: boolean;
}
export interface DisplayConfigResource extends ClerkResource {
id: string;
instanceEnvironmentType: string;
applicationName: string;
theme: object;
preferred_sign_in_strategy: PreferredSignInStrategy;
logo_image: LogoImageJSON;
backend_host: string;
home_url: string;
sign_in_url: string;
sign_up_url: string;
user_profile_url: string;
after_sign_in_url: string;
after_sign_up_url: string;
after_sign_out_one_url: string;
after_sign_out_all_url: string;
after_switch_session_url: string;
preferredSignInStrategy: PreferredSignInStrategy;
logoImage: LogoImageJSON;
backendHost: string;
homeUrl: string;
signInUrl: string;
signUpUrl: string;
userProfileUrl: string;
afterSignInUrl: string;
afterSignUpUrl: string;
afterSignOutUrl: string;
afterSignOutOneUrl: string;
afterSignOutAllUrl: string;
afterSwitchSessionUrl: string;
}
export interface EnvironmentResource extends ClerkResource {
authConfig: AuthConfigJSON;
displayConfig: DisplayConfigJSON;
authConfig: AuthConfigResource;
displayConfig: DisplayConfigResource;
}
export {};
{
"name": "@clerk/clerk-react",
"version": "1.1.1",
"version": "1.1.2-staging.0",
"license": "MIT",

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

# @clerk/clerk-react
![Clerk.dev](clerk.png)
[Clerk.dev](https://clerk.dev)
Simple and beautiful user management.
Add sign up, sign in, and profile management to your application in minutes. Theme our prebuilt frontends to match your branding, or customize everything with our APIs.
[Go to Clerk.dev official documentation](https://frontend-docs.clerk.dev/)

Sorry, the diff of this file is not supported yet

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