@poly-x/react 0.1.0-alpha.0 → 0.1.0-alpha.1

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.
package/dist/index.cjs CHANGED
@@ -109,7 +109,7 @@ function createLoginController(deps) {
109
109
  redirectUri,
110
110
  createdAt: Date.now()
111
111
  });
112
- const url = authClient.buildAuthorizeUrl({
112
+ const url = authClient.buildSignInUrl({
113
113
  redirectUri,
114
114
  state,
115
115
  challenge,
@@ -257,12 +257,13 @@ var WebLocksLock = class {
257
257
  };
258
258
  //#endregion
259
259
  //#region src/provider.tsx
260
- function PolyXProvider({ publishableKey, baseUrl, children }) {
260
+ function PolyXProvider({ publishableKey, baseUrl, signInUrl, children }) {
261
261
  const value = (0, react.useMemo)(() => {
262
262
  const authClient = new _poly_x_core.AuthClient({
263
263
  config: (0, _poly_x_core.resolveConfig)({
264
264
  key: publishableKey,
265
265
  baseUrl,
266
+ signInUrl,
266
267
  context: "browser"
267
268
  }),
268
269
  transport: new _poly_x_core.FetchTransport()
@@ -284,7 +285,11 @@ function PolyXProvider({ publishableKey, baseUrl, children }) {
284
285
  channel: new BroadcastAuthChannel()
285
286
  })
286
287
  };
287
- }, [publishableKey, baseUrl]);
288
+ }, [
289
+ publishableKey,
290
+ baseUrl,
291
+ signInUrl
292
+ ]);
288
293
  (0, react.useEffect)(() => {
289
294
  value.engine.hydrate();
290
295
  return () => value.engine.dispose();
package/dist/index.d.cts CHANGED
@@ -7,11 +7,14 @@ interface PolyXProviderProps {
7
7
  publishableKey: string;
8
8
  /** Override the key-embedded deployment host (proxies, container-internal). */
9
9
  baseUrl?: string;
10
+ /** Hosted sign-in page URL (the account portal) the login popup/redirect opens. */
11
+ signInUrl?: string;
10
12
  children: ReactNode;
11
13
  }
12
14
  declare function PolyXProvider({
13
15
  publishableKey,
14
16
  baseUrl,
17
+ signInUrl,
15
18
  children
16
19
  }: PolyXProviderProps): ReactNode;
17
20
  //#endregion
package/dist/index.d.mts CHANGED
@@ -7,11 +7,14 @@ interface PolyXProviderProps {
7
7
  publishableKey: string;
8
8
  /** Override the key-embedded deployment host (proxies, container-internal). */
9
9
  baseUrl?: string;
10
+ /** Hosted sign-in page URL (the account portal) the login popup/redirect opens. */
11
+ signInUrl?: string;
10
12
  children: ReactNode;
11
13
  }
12
14
  declare function PolyXProvider({
13
15
  publishableKey,
14
16
  baseUrl,
17
+ signInUrl,
15
18
  children
16
19
  }: PolyXProviderProps): ReactNode;
17
20
  //#endregion
package/dist/index.mjs CHANGED
@@ -108,7 +108,7 @@ function createLoginController(deps) {
108
108
  redirectUri,
109
109
  createdAt: Date.now()
110
110
  });
111
- const url = authClient.buildAuthorizeUrl({
111
+ const url = authClient.buildSignInUrl({
112
112
  redirectUri,
113
113
  state,
114
114
  challenge,
@@ -256,12 +256,13 @@ var WebLocksLock = class {
256
256
  };
257
257
  //#endregion
258
258
  //#region src/provider.tsx
259
- function PolyXProvider({ publishableKey, baseUrl, children }) {
259
+ function PolyXProvider({ publishableKey, baseUrl, signInUrl, children }) {
260
260
  const value = useMemo(() => {
261
261
  const authClient = new AuthClient({
262
262
  config: resolveConfig({
263
263
  key: publishableKey,
264
264
  baseUrl,
265
+ signInUrl,
265
266
  context: "browser"
266
267
  }),
267
268
  transport: new FetchTransport()
@@ -283,7 +284,11 @@ function PolyXProvider({ publishableKey, baseUrl, children }) {
283
284
  channel: new BroadcastAuthChannel()
284
285
  })
285
286
  };
286
- }, [publishableKey, baseUrl]);
287
+ }, [
288
+ publishableKey,
289
+ baseUrl,
290
+ signInUrl
291
+ ]);
287
292
  useEffect(() => {
288
293
  value.engine.hydrate();
289
294
  return () => value.engine.dispose();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@poly-x/react",
3
- "version": "0.1.0-alpha.0",
3
+ "version": "0.1.0-alpha.1",
4
4
  "description": "PolyX SDK for React SPAs - provider, hooks, drop-in auth UI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -24,7 +24,7 @@
24
24
  "module": "./dist/index.mjs",
25
25
  "types": "./dist/index.d.cts",
26
26
  "dependencies": {
27
- "@poly-x/core": "0.1.0-alpha.0"
27
+ "@poly-x/core": "0.1.0-alpha.1"
28
28
  },
29
29
  "peerDependencies": {
30
30
  "react": ">=18",