@clerk/chrome-extension
Advanced tools
Comparing version 0.3.8-staging.1c0bc9c to 0.3.8-staging.4ae3069
@@ -1,2 +0,2 @@ | ||
"use strict";var w=Object.create;var p=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var W=Object.getPrototypeOf,F=Object.prototype.hasOwnProperty;var I=(e,r)=>{for(var o in r)p(e,o,{get:r[o],enumerable:!0})},C=(e,r,o,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let t of R(r))!F.call(e,t)&&t!==o&&p(e,t,{get:()=>r[t],enumerable:!(n=E(r,t))||n.enumerable});return e},m=(e,r,o)=>(C(e,r,"default"),o&&C(o,r,"default")),h=(e,r,o)=>(o=e!=null?w(W(e)):{},C(r||!e||!e.__esModule?p(o,"default",{value:e,enumerable:!0}):o,e)),A=e=>C(p({},"__esModule",{value:!0}),e);var k={};I(k,{ClerkProvider:()=>x});module.exports=A(k);m(k,require("@clerk/clerk-react"),module.exports);var u=h(require("react")),l=require("@clerk/clerk-react"),b=h(require("@clerk/clerk-js"));function d(e=""){return`https://${atob(e.replace(/pk_(test|live)_/,"")).slice(0,-1)}`}async function g(e){return chrome.cookies.get({url:e,name:"__client"})}function v(e,r){return chrome.storage.local.set({[e]:r})}function f(e){return chrome.storage.local.get(e).then(r=>r[e])}var B=()=>{let e={};return{saveToken:(r,o)=>(e[r]=o,Promise.resolve()),getToken:r=>Promise.resolve(e[r])}},K=()=>({saveToken:v,getToken:f}),S=K(),j=B();var _=h(require("@clerk/clerk-js"));var P="__clerk_client_jwt",a,T=e=>console.error(e);async function y({publishableKey:e,tokenCache:r}){if(!a){let o=d(e),n=await g(o).catch(T);n&&await r.saveToken(P,n.value).catch(T),a=new _.default(e),a.__unstable__onBeforeRequest(async t=>{var s;t.credentials="omit",(s=t.url)==null||s.searchParams.append("_is_native","1");let i=await r.getToken(P);t.headers.set("authorization",i||"")}),a.__unstable__onAfterResponse(async(t,i)=>{let s=i.headers.get("authorization");s&&await r.saveToken(P,s)})}return a}var c=require("react/jsx-runtime");(0,l.__internal__setErrorThrowerOptions)({packageName:"@clerk/chrome-extension"});var H=e=>{let{children:r,tokenCache:o,...n}=e,{publishableKey:t=""}=e,[i,s]=u.default.useState(null),O=o||S;return u.default.useEffect(()=>{(async()=>s(await y({publishableKey:t,tokenCache:O})))()},[]),i?(0,c.jsx)(l.ClerkProvider,{...n,Clerk:i,standardBrowser:!1,children:r}):null},J=e=>{let{children:r,...o}=e;return(0,c.jsx)(l.ClerkProvider,{...o,Clerk:b.default,children:r})};function x(e){let{tokenCache:r,syncSessionWithTab:o,...n}=e;return o?(0,c.jsx)(H,{...e,tokenCache:r}):(0,c.jsx)(J,{...n})}0&&(module.exports={ClerkProvider}); | ||
"use strict";var w=Object.create;var p=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var W=Object.getPrototypeOf,F=Object.prototype.hasOwnProperty;var I=(e,r)=>{for(var o in r)p(e,o,{get:r[o],enumerable:!0})},C=(e,r,o,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let t of R(r))!F.call(e,t)&&t!==o&&p(e,t,{get:()=>r[t],enumerable:!(n=E(r,t))||n.enumerable});return e},m=(e,r,o)=>(C(e,r,"default"),o&&C(o,r,"default")),h=(e,r,o)=>(o=e!=null?w(W(e)):{},C(r||!e||!e.__esModule?p(o,"default",{value:e,enumerable:!0}):o,e)),A=e=>C(p({},"__esModule",{value:!0}),e);var k={};I(k,{ClerkProvider:()=>x});module.exports=A(k);m(k,require("@clerk/clerk-react"),module.exports);var u=h(require("react")),l=require("@clerk/clerk-react"),b=h(require("@clerk/clerk-js"));function d(e=""){return`https://${atob(e.replace(/pk_(test|live)_/,"")).slice(0,-1)}`}async function g(e){return chrome.cookies.get({url:e,name:"__client"})}function v(e,r){return chrome.storage.local.set({[e]:r})}function f(e){return chrome.storage.local.get(e).then(r=>r[e])}var B=()=>{let e={};return{saveToken:(r,o)=>(e[r]=o,Promise.resolve()),getToken:r=>Promise.resolve(e[r])}},K=()=>({saveToken:v,getToken:f}),S=K(),j=B();var _=h(require("@clerk/clerk-js"));var P="__clerk_client_jwt",a,T=e=>console.error(e);async function y({publishableKey:e,tokenCache:r}){if(!a){let o=d(e),n=await g(o).catch(T);n&&await r.saveToken(P,n.value).catch(T),a=new _.default(e),a.__unstable__onBeforeRequest(async t=>{var s;t.credentials="omit",(s=t.url)==null||s.searchParams.append("_is_native","1");let i=await r.getToken(P);t.headers.set("authorization",i||"")}),a.__unstable__onAfterResponse(async(t,i)=>{let s=i.headers.get("authorization");s&&await r.saveToken(P,s)})}return a}var c=require("react/jsx-runtime");(0,l.__internal__setErrorThrowerOptions)({packageName:"@clerk/chrome-extension"});var H=e=>{let{children:r,tokenCache:o,...n}=e,{publishableKey:t=""}=e,[i,s]=u.default.useState(null),O=o||S;return u.default.useEffect(()=>{(async()=>s(await y({publishableKey:t,tokenCache:O})))()},[]),i?(0,c.jsx)(l.ClerkProvider,{...n,Clerk:i,standardBrowser:!1,children:r}):null},J=e=>{let{children:r,...o}=e;return(0,c.jsx)(l.ClerkProvider,{...o,Clerk:b.default,children:r})};function x(e){let{tokenCache:r,syncSessionWithTab:o,...n}=e;return o?(0,c.jsx)(H,{...e,tokenCache:r}):(0,c.jsx)(J,{...n})}0&&(module.exports={ClerkProvider,...require("@clerk/clerk-react")}); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@clerk/chrome-extension", | ||
"version": "0.3.8-staging.1c0bc9c", | ||
"version": "0.3.8-staging.4ae3069", | ||
"license": "MIT", | ||
@@ -31,3 +31,3 @@ "description": "Clerk SDK for Chrome extensions", | ||
"dependencies": { | ||
"@clerk/clerk-js": "4.45.1-staging.1c0bc9c", | ||
"@clerk/clerk-js": "4.45.1-staging.4ae3069", | ||
"@clerk/clerk-react": "^4.18.0" | ||
@@ -34,0 +34,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
35191
3385
+ Added@clerk/clerk-js@4.45.1-staging.4ae3069(transitive)
- Removed@clerk/clerk-js@4.45.1-staging.1c0bc9c(transitive)