@clerk/clerk-react
Advanced tools
Comparing version 4.8.5-staging.2 to 4.9.0-staging.0
/** DO NOT EDIT: This file is automatically generated by ../scripts/info.js */ | ||
export declare const LIB_VERSION = "4.8.5-staging.2"; | ||
export declare const LIB_VERSION = "4.9.0-staging.0"; | ||
export declare const LIB_NAME = "@clerk/clerk-react"; |
@@ -5,3 +5,3 @@ "use strict"; | ||
/** DO NOT EDIT: This file is automatically generated by ../scripts/info.js */ | ||
exports.LIB_VERSION = '4.8.5-staging.2'; | ||
exports.LIB_VERSION = '4.9.0-staging.0'; | ||
exports.LIB_NAME = '@clerk/clerk-react'; |
@@ -12,2 +12,3 @@ import type { ActiveSessionResource, AuthenticateWithMetamaskParams, ClientResource, CreateOrganizationParams, CreateOrganizationProps, HandleMagicLinkVerificationParams, HandleOAuthCallbackParams, OrganizationMembershipResource, OrganizationResource, RedirectOptions, Resources, SetActiveParams, SignInProps, SignOut, SignUpProps, UserButtonProps, UserProfileProps, UserResource } from '@clerk/types'; | ||
private publishableKey?; | ||
private proxyUrl?; | ||
private options; | ||
@@ -14,0 +15,0 @@ private Clerk; |
@@ -410,5 +410,6 @@ "use strict"; | ||
}; | ||
const _b = options || {}, { Clerk = null, frontendApi, publishableKey } = _b, rest = tslib_1.__rest(_b, ["Clerk", "frontendApi", "publishableKey"]); | ||
const { Clerk = null, frontendApi, publishableKey } = options || {}; | ||
this.frontendApi = frontendApi; | ||
this.publishableKey = publishableKey; | ||
this.proxyUrl = options === null || options === void 0 ? void 0 : options.proxyUrl; | ||
this.options = options; | ||
@@ -433,2 +434,3 @@ this.Clerk = Clerk; | ||
window.__clerk_publishable_key = this.publishableKey; | ||
window.__clerk_proxy_url = this.proxyUrl; | ||
try { | ||
@@ -440,3 +442,5 @@ if (this.Clerk) { | ||
// Construct a new Clerk object if a constructor is passed | ||
c = new this.Clerk(this.publishableKey || this.frontendApi || ''); | ||
c = new this.Clerk(this.publishableKey || this.frontendApi || '', { | ||
proxyUrl: this.proxyUrl, | ||
}); | ||
await c.load(this.options); | ||
@@ -458,2 +462,3 @@ } | ||
publishableKey: this.publishableKey, | ||
proxyUrl: this.proxyUrl, | ||
scriptUrl: this.options.clerkJSUrl, | ||
@@ -460,0 +465,0 @@ scriptVariant: this.options.clerkJSVariant, |
@@ -7,4 +7,6 @@ /// <reference types="react" /> | ||
__clerk_publishable_key?: string; | ||
__clerk_proxy_url?: ClerkConstructorOptions['proxyUrl']; | ||
} | ||
} | ||
export type ClerkConstructorOptions = Pick<Clerk, 'proxyUrl'>; | ||
export type IsomorphicClerkOptions = ClerkOptions & { | ||
@@ -16,6 +18,6 @@ Clerk?: ClerkProp; | ||
export interface BrowserClerkConstructor { | ||
new (publishableKey: string): BrowserClerk; | ||
new (publishableKey: string, options?: ClerkConstructorOptions): BrowserClerk; | ||
} | ||
export interface HeadlessBrowserClerkConstrutor { | ||
new (publishableKey: string): HeadlessBrowserClerk; | ||
new (publishableKey: string, options?: ClerkConstructorOptions): HeadlessBrowserClerk; | ||
} | ||
@@ -22,0 +24,0 @@ export type WithClerkProp<T = unknown> = T & { |
@@ -12,2 +12,3 @@ import { BrowserClerk } from '../types'; | ||
publishableKey?: string; | ||
proxyUrl?: string; | ||
scriptUrl?: string; | ||
@@ -14,0 +15,0 @@ scriptVariant?: ScriptVariant; |
@@ -48,3 +48,3 @@ "use strict"; | ||
return new Promise((resolve, reject) => { | ||
const { frontendApi, publishableKey } = params; | ||
const { frontendApi, publishableKey, proxyUrl } = params; | ||
if (global.Clerk) { | ||
@@ -63,2 +63,5 @@ resolve(null); | ||
} | ||
if (proxyUrl) { | ||
script.setAttribute('data-clerk-proxy-url', proxyUrl); | ||
} | ||
script.setAttribute('crossorigin', 'anonymous'); | ||
@@ -65,0 +68,0 @@ script.async = true; |
{ | ||
"name": "@clerk/clerk-react", | ||
"version": "4.8.5-staging.2", | ||
"version": "4.9.0-staging.0", | ||
"license": "MIT", | ||
@@ -32,4 +32,4 @@ "description": "Clerk.dev React library", | ||
"dependencies": { | ||
"@clerk/shared": "^0.9.3-staging.2", | ||
"@clerk/types": "^3.24.2-staging.1", | ||
"@clerk/shared": "^0.9.3-staging.3", | ||
"@clerk/types": "^3.25.0-staging.0", | ||
"swr": "1.3.0", | ||
@@ -70,3 +70,3 @@ "tslib": "2.4.1" | ||
}, | ||
"gitHead": "9815c6c2439dec80b3ca58b90b6d01266426ffe3" | ||
"gitHead": "4dd2de92d558c2018b2b76eea886692a2d745823" | ||
} |
115545
2487