@auth0/auth0-acul-react 1.0.0-alpha.0 → 1.0.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/README.md CHANGED
@@ -1,5 +1,4 @@
1
- # @auth0/auth0-acul-react
2
- Developers using Auth0’s Universal Login can use this React SDK to customize screens like login, signup, or reset password. It provides hooks, context, and utilities to build flexible, type-safe experiences that match your brand and deliver a seamless user experience.
1
+ # Auth0 ACUL React SDK
3
2
 
4
3
  <div align="center">
5
4
 
@@ -16,15 +15,14 @@ Developers using Auth0’s Universal Login can use this React SDK to customize s
16
15
 
17
16
  </div>
18
17
 
19
- ## Table of Contents
20
- - [Installation](#installation)
21
- - [Importing the SDK](#importing-the-sdk)
22
- - [Partial Imports](#partial-imports)
23
- - [Root Imports](#root-imports)
24
- - [Types / Interfaces](#types--interfaces)
25
- - [Examples](#examples)
18
+ Developers using Auth0’s Universal Login can use this React SDK to customize screens like login, signup, or reset password. It provides hooks, context, and utilities to build flexible, type-safe experiences that match your brand and deliver a seamless user experience.
19
+
26
20
  ---
27
21
 
22
+ > [!CAUTION]
23
+ >
24
+ > This feature is still in **Early Access**.
25
+
28
26
  ## Installation
29
27
 
30
28
  ```bash
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @module Getting Started
3
- * @description This module provides an overview of how to get started with the Auth0 SDK.
3
+ * @description This module provides an overview of how to get started with the Auth0 ACUL React SDK.
4
4
  *
5
5
  * # Auth0 ACUL React SDK
6
6
  *
@@ -104,7 +104,7 @@
104
104
  * import {
105
105
  * useScreen,
106
106
  * useTransaction,
107
- * useMfaPollingManager,
107
+ * useMfaPolling,
108
108
  * continueMethod,
109
109
  * resendPushNotification
110
110
  * } from '@auth0/auth0-acul-react/mfa-push-challenge-push';
@@ -114,7 +114,7 @@
114
114
  * const transaction = useTransaction();
115
115
  * const [status, setStatus] = useState('waiting');
116
116
  *
117
- * const { isRunning, startPolling, stopPolling } = useMfaPollingManager({
117
+ * const { isRunning, startPolling, stopPolling } = useMfaPolling({
118
118
  * intervalMs: 5000,
119
119
  * onComplete: async () => {
120
120
  * setStatus('approved');
@@ -171,7 +171,7 @@
171
171
  * }
172
172
  * ```
173
173
  *
174
- * ## Available Hooks by Screen
174
+ * ## Available Hooks
175
175
  *
176
176
  * ### Context Hooks (Available in all screens)
177
177
  * - `useUser()` - Current user information
@@ -232,71 +232,17 @@
232
232
  * import {
233
233
  * continueMethod,
234
234
  * resendPushNotification,
235
- * useMfaPollingManager
235
+ * useMfaPolling
236
236
  * } from '@auth0/auth0-acul-react/mfa-push-challenge-push';
237
237
  * ```
238
238
  *
239
- * ## Import Patterns
240
- *
241
- * ### Screen-Specific Imports (Recommended)
242
- * ```tsx
243
- * // Import from specific screen modules
244
- * import { useUser, loginMethod } from '@auth0/auth0-acul-react/login-id';
245
- * import { useMfaPollingManager } from '@auth0/auth0-acul-react/mfa-push-challenge-push';
246
- * ```
247
- * ## Available Screen Modules
248
- *
249
- * | Screen Module | Import Path | Description |
250
- * |---------------|-------------|-------------|
251
- * | Login ID | `@auth0/auth0-acul-react/login-id` | Username/email identification |
252
- * | Login Password | `@auth0/auth0-acul-react/login-password` | Password entry screen |
253
- * | MFA Push Challenge | `@auth0/auth0-acul-react/mfa-push-challenge-push` | Push notification MFA |
254
- * | Reset Password MFA Push | `@auth0/auth0-acul-react/reset-password-mfa-push-challenge-push` | Reset password with MFA |
255
- * | Signup ID | `@auth0/auth0-acul-react/signup-id` | User registration |
256
- * | Signup Password | `@auth0/auth0-acul-react/signup-password` | Password setup during registration |
257
- *
258
239
  * ## Best Practices
259
240
  *
260
- * ### 1. **Use Screen-Specific Imports**
261
- * ```tsx
262
- * // Partial import - recommended
263
- * import { useSignup } from '@auth0/auth0-acul-react/signup';
264
- * // Root import
265
- * import * as Auth0React from '@auth0/auth0-acul-react';
266
- *
267
- * const MyComponent = () => {
268
- * const signupInstance = useSignup();
269
- * // Use methods or other properties using the instance
270
- * return (
271
- * <button onClick={() => signupInstance.signup({ username: 'user', password: 'pass' })}>
272
- * Sign Up
273
- * </button>
274
- * );
275
- * };
241
+ * - Use **screen-specific modules**
242
+ * - Handle errors using `useErrors()`
243
+ * - Use context hooks (like `useTenant`, `useScreen`) for dynamic branding, layout, or behavior
276
244
  *
277
- * ```
278
245
  *
279
- * ### 2. **Handle Loading States**
280
- * ```tsx
281
- * function LoginForm() {
282
- * const [isLoading, setIsLoading] = useState(false);
283
- *
284
- * const handleSubmit = async (data) => {
285
- * setIsLoading(true);
286
- * try {
287
- * await loginMethod(data);
288
- * } finally {
289
- * setIsLoading(false);
290
- * }
291
- * };
292
- *
293
- * return (
294
- * <button disabled={isLoading}>
295
- * {isLoading ? 'Signing in...' : 'Sign In'}
296
- * </button>
297
- * );
298
- * }
299
- * ```
300
246
  *
301
247
  * ## Examples and Resources
302
248
  *
@@ -1,8 +1,9 @@
1
- import type { MfaEmailChallengeMembers, ContinueOptions, ResendCodeOptions, TryAnotherMethodOptions } from '@auth0/auth0-acul-js/mfa-email-challenge';
1
+ import type { MfaEmailChallengeMembers, ContinueOptions, ResendCodeOptions, TryAnotherMethodOptions, CustomOptions } from '@auth0/auth0-acul-js/mfa-email-challenge';
2
2
  export declare const useUser: () => import("@auth0/auth0-acul-js").UserMembers, useTenant: () => import("@auth0/auth0-acul-js").TenantMembers, useBranding: () => import("@auth0/auth0-acul-js").BrandingMembers, useClient: () => import("@auth0/auth0-acul-js").ClientMembers, useOrganization: () => import("@auth0/auth0-acul-js").OrganizationMembers, usePrompt: () => import("@auth0/auth0-acul-js").PromptMembers, useScreen: () => import("@auth0/auth0-acul-js").ScreenMembersOnMfaEmailChallenge, useTransaction: () => import("@auth0/auth0-acul-js").TransactionMembers, useUntrustedData: () => import("@auth0/auth0-acul-js").UntrustedDataMembersOnMfaEmailChallenge;
3
3
  export declare const continueMethod: (payload: ContinueOptions) => void | Promise<void>;
4
4
  export declare const resendCode: (payload?: ResendCodeOptions) => void | Promise<void>;
5
5
  export declare const tryAnotherMethod: (payload?: TryAnotherMethodOptions) => void | Promise<void>;
6
+ export declare const pickEmail: (payload?: CustomOptions) => void | Promise<void>;
6
7
  export { useResend } from '../hooks/utility/resend-manager';
7
8
  export { useCurrentScreen, useErrors, useAuth0Themes, type UseErrorOptions, type UseErrorsResult, type ErrorsResult, type ErrorKind, } from '../hooks';
8
9
  export declare const useMfaEmailChallenge: () => MfaEmailChallengeMembers;
@@ -1,2 +1,2 @@
1
- import e from"@auth0/auth0-acul-js/mfa-email-challenge";import{useMemo as o}from"react";export{useAuth0Themes}from"../hooks/common/auth0-themes.js";export{useCurrentScreen}from"../hooks/common/current-screen.js";import{errorManager as r}from"../hooks/common/errors.js";export{useErrors}from"../hooks/common/errors.js";import{ContextHooks as s}from"../hooks/context/index.js";import{registerScreen as t}from"../state/instance-store.js";export{useResend}from"../hooks/utility/resend-manager.js";const n=t(e),{withError:m}=r,u=new s(n),{useUser:a,useTenant:i,useBranding:c,useClient:h,useOrganization:p,usePrompt:f,useScreen:d,useTransaction:j,useUntrustedData:x}=u,k=e=>m(n.continue(e)),l=e=>m(n.resendCode(e)),g=e=>m(n.tryAnotherMethod(e)),C=()=>o(()=>n,[]);export{k as continueMethod,l as resendCode,g as tryAnotherMethod,c as useBranding,h as useClient,C as useMfaEmailChallenge,p as useOrganization,f as usePrompt,d as useScreen,i as useTenant,j as useTransaction,x as useUntrustedData,a as useUser};
1
+ import e from"@auth0/auth0-acul-js/mfa-email-challenge";import{useMemo as o}from"react";export{useAuth0Themes}from"../hooks/common/auth0-themes.js";export{useCurrentScreen}from"../hooks/common/current-screen.js";import{errorManager as r}from"../hooks/common/errors.js";export{useErrors}from"../hooks/common/errors.js";import{ContextHooks as s}from"../hooks/context/index.js";import{registerScreen as t}from"../state/instance-store.js";export{useResend}from"../hooks/utility/resend-manager.js";const n=t(e),{withError:m}=r,u=new s(n),{useUser:a,useTenant:i,useBranding:c,useClient:h,useOrganization:p,usePrompt:f,useScreen:d,useTransaction:j,useUntrustedData:k}=u,l=e=>m(n.continue(e)),x=e=>m(n.resendCode(e)),g=e=>m(n.tryAnotherMethod(e)),C=e=>m(n.pickEmail(e)),E=()=>o(()=>n,[]);export{l as continueMethod,C as pickEmail,x as resendCode,g as tryAnotherMethod,c as useBranding,h as useClient,E as useMfaEmailChallenge,p as useOrganization,f as usePrompt,d as useScreen,i as useTenant,j as useTransaction,k as useUntrustedData,a as useUser};
2
2
  //# sourceMappingURL=mfa-email-challenge.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mfa-email-challenge.js","sources":["../../src/screens/mfa-email-challenge.tsx"],"sourcesContent":["import MfaEmailChallenge from '@auth0/auth0-acul-js/mfa-email-challenge';\nimport { useMemo } from 'react';\n\nimport { ContextHooks } from '../hooks';\nimport { errorManager } from '../hooks';\nimport { registerScreen } from '../state/instance-store';\n\nimport type {\n MfaEmailChallengeMembers,\n ContinueOptions,\n ResendCodeOptions,\n TryAnotherMethodOptions,\n} from '@auth0/auth0-acul-js/mfa-email-challenge';\n\n// Register the singleton instance of MfaEmailChallenge\nconst instance = registerScreen<MfaEmailChallengeMembers>(MfaEmailChallenge)!;\n\n// Error wrapper\nconst { withError } = errorManager;\n\n// Context hooks\nconst factory = new ContextHooks<MfaEmailChallengeMembers>(instance);\nexport const {\n useUser,\n useTenant,\n useBranding,\n useClient,\n useOrganization,\n usePrompt,\n useScreen,\n useTransaction,\n useUntrustedData,\n} = factory;\n\n// Submit functions\nexport const continueMethod = (payload: ContinueOptions) => withError(instance.continue(payload));\nexport const resendCode = (payload?: ResendCodeOptions) => withError(instance.resendCode(payload));\nexport const tryAnotherMethod = (payload?: TryAnotherMethodOptions) =>\n withError(instance.tryAnotherMethod(payload));\n\n// Utility Hooks\nexport { useResend } from '../hooks/utility/resend-manager';\n\n// Common hooks\nexport {\n useCurrentScreen,\n useErrors,\n useAuth0Themes,\n type UseErrorOptions,\n type UseErrorsResult,\n type ErrorsResult,\n type ErrorKind,\n} from '../hooks';\n\n// Main instance hook. Returns singleton instance of MfaEmailChallenge\nexport const useMfaEmailChallenge = (): MfaEmailChallengeMembers => useMemo(() => instance, []);\n\n// Export all types from the core SDK for this screen\n"],"names":["instance","registerScreen","MfaEmailChallenge","withError","errorManager","factory","ContextHooks","useUser","useTenant","useBranding","useClient","useOrganization","usePrompt","useScreen","useTransaction","useUntrustedData","continueMethod","payload","continue","resendCode","tryAnotherMethod","useMfaEmailChallenge","useMemo"],"mappings":"6eAeA,MAAMA,EAAWC,EAAyCC,IAGpDC,UAAEA,GAAcC,EAGhBC,EAAU,IAAIC,EAAuCN,IAC9CO,QACXA,EAAOC,UACPA,EAASC,YACTA,EAAWC,UACXA,EAASC,gBACTA,EAAeC,UACfA,EAASC,UACTA,EAASC,eACTA,EAAcC,iBACdA,GACEV,EAGSW,EAAkBC,GAA6Bd,EAAUH,EAASkB,SAASD,IAC3EE,EAAcF,GAAgCd,EAAUH,EAASmB,WAAWF,IAC5EG,EAAoBH,GAC/Bd,EAAUH,EAASoB,iBAAiBH,IAiBzBI,EAAuB,IAAgCC,EAAQ,IAAMtB,EAAU"}
1
+ {"version":3,"file":"mfa-email-challenge.js","sources":["../../src/screens/mfa-email-challenge.tsx"],"sourcesContent":["import MfaEmailChallenge from '@auth0/auth0-acul-js/mfa-email-challenge';\nimport { useMemo } from 'react';\n\nimport { ContextHooks } from '../hooks';\nimport { errorManager } from '../hooks';\nimport { registerScreen } from '../state/instance-store';\n\nimport type {\n MfaEmailChallengeMembers,\n ContinueOptions,\n ResendCodeOptions,\n TryAnotherMethodOptions,\n CustomOptions,\n} from '@auth0/auth0-acul-js/mfa-email-challenge';\n\n// Register the singleton instance of MfaEmailChallenge\nconst instance = registerScreen<MfaEmailChallengeMembers>(MfaEmailChallenge)!;\n\n// Error wrapper\nconst { withError } = errorManager;\n\n// Context hooks\nconst factory = new ContextHooks<MfaEmailChallengeMembers>(instance);\nexport const {\n useUser,\n useTenant,\n useBranding,\n useClient,\n useOrganization,\n usePrompt,\n useScreen,\n useTransaction,\n useUntrustedData,\n} = factory;\n\n// Submit functions\nexport const continueMethod = (payload: ContinueOptions) => withError(instance.continue(payload));\nexport const resendCode = (payload?: ResendCodeOptions) => withError(instance.resendCode(payload));\nexport const tryAnotherMethod = (payload?: TryAnotherMethodOptions) =>\n withError(instance.tryAnotherMethod(payload));\nexport const pickEmail = (payload?: CustomOptions) => withError(instance.pickEmail(payload));\n\n// Utility Hooks\nexport { useResend } from '../hooks/utility/resend-manager';\n\n// Common hooks\nexport {\n useCurrentScreen,\n useErrors,\n useAuth0Themes,\n type UseErrorOptions,\n type UseErrorsResult,\n type ErrorsResult,\n type ErrorKind,\n} from '../hooks';\n\n// Main instance hook. Returns singleton instance of MfaEmailChallenge\nexport const useMfaEmailChallenge = (): MfaEmailChallengeMembers => useMemo(() => instance, []);\n\n// Export all types from the core SDK for this screen\n"],"names":["instance","registerScreen","MfaEmailChallenge","withError","errorManager","factory","ContextHooks","useUser","useTenant","useBranding","useClient","useOrganization","usePrompt","useScreen","useTransaction","useUntrustedData","continueMethod","payload","continue","resendCode","tryAnotherMethod","pickEmail","useMfaEmailChallenge","useMemo"],"mappings":"6eAgBA,MAAMA,EAAWC,EAAyCC,IAGpDC,UAAEA,GAAcC,EAGhBC,EAAU,IAAIC,EAAuCN,IAC9CO,QACXA,EAAOC,UACPA,EAASC,YACTA,EAAWC,UACXA,EAASC,gBACTA,EAAeC,UACfA,EAASC,UACTA,EAASC,eACTA,EAAcC,iBACdA,GACEV,EAGSW,EAAkBC,GAA6Bd,EAAUH,EAASkB,SAASD,IAC3EE,EAAcF,GAAgCd,EAAUH,EAASmB,WAAWF,IAC5EG,EAAoBH,GAC/Bd,EAAUH,EAASoB,iBAAiBH,IACzBI,EAAaJ,GAA4Bd,EAAUH,EAASqB,UAAUJ,IAiBtEK,EAAuB,IAAgCC,EAAQ,IAAMvB,EAAU"}
package/dist/telemetry.js CHANGED
@@ -1,2 +1,2 @@
1
- globalThis.__ACUL_SDK_NAME__="@auth0/auth0-acul-react",globalThis.__ACUL_SDK_VERSION__="1.0.0-alpha.0";
1
+ globalThis.__ACUL_SDK_NAME__="@auth0/auth0-acul-react",globalThis.__ACUL_SDK_VERSION__="1.0.0-alpha.1";
2
2
  //# sourceMappingURL=telemetry.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@auth0/auth0-acul-react",
3
- "version": "1.0.0-alpha.0",
3
+ "version": "1.0.0-alpha.1",
4
4
  "main": "dist/index.js",
5
5
  "type": "module",
6
6
  "types": "dist/index.d.ts",
@@ -20,10 +20,12 @@
20
20
  "license": "MIT",
21
21
  "description": "The Auth0 ACUL React SDK enables you to build Advanced Customization for Universal Login with React hooks and components.",
22
22
  "repository": {
23
- "type": "git"
23
+ "type": "git",
24
+ "url": "https://github.com/auth0/universal-login/tree/master/packages/auth0-acul-react"
24
25
  },
25
26
  "peerDependencies": {
26
- "react": "^18.3.1"
27
+ "react": ">=18.0.0",
28
+ "react-dom": ">=18.0.0"
27
29
  },
28
30
  "exports": {
29
31
  ".": {
@@ -47,7 +49,7 @@
47
49
  "ts-node": "^10.9.2"
48
50
  },
49
51
  "dependencies": {
50
- "@auth0/auth0-acul-js": "1.0.0-alpha.0"
52
+ "@auth0/auth0-acul-js": "1.0.0-alpha.1"
51
53
  },
52
54
  "files": [
53
55
  "dist",
@@ -58,4 +60,4 @@
58
60
  "publishConfig": {
59
61
  "access": "public"
60
62
  }
61
- }
63
+ }