How it works
My Account components use the My Account API’s authentication methods endpoints to render an authentication-management UI inside your application.The My Account API currently enforces low rate limits, especially on free-tier tenants. This may cause errors while using these components.
/me/v1/authentication-methods as the logged-in user, so each user can only view and modify their own authentication methods.
Available components
- These components create end-user self-service interfaces. End users can enroll, list, and remove every authentication method on their own account: email OTP, SMS OTP, TOTP (authenticator application), push notifications, passkeys, and recovery codes.
- For delegated admin interfaces in which a user manages an Auth0 Organization, read Build a Delegated Admin Interface.
- React (SPA)
- Next.js (RWA)
- shadcn
Prerequisites
Enable My Account API
- Navigate to Dashboard > Applications > APIs.
- Select Activate My Account API to enable it for your tenant.
Create the application and configure My Account API permissions
- Navigate to Dashboard > Applications > Applications, and select Create Application.
- Select Single Page Web Applications.
-
Select the Settings tab and add your Callback, Logout, and Web Origins URLs. For example:
http://localhost:5173. - Select the API Access tab.
-
Select Edit for the Auth0 My Account API to add the User-delegated Access permissions:
create:me:authentication_methodsread:me:authentication_methodsupdate:me:authentication_methodsdelete:me:authentication_methodsread:me:factors - Select Save to save the permissions.
- The user’s access token only includes permissions that were granted during login.
- Request all five scopes to allow users to enroll, review, and remove authentication methods.
Set up the database and test user
- Navigate to Dashboard > Authentication > Database to create a database connection.
- In the Applications tab of the database, enable your application.
- Navigate to Dashboard > User Management > Users.
- Select Create User to create a user assigned to the new database connection.
- Select Create to add the new user; use this new user for testing.
Configure your application
Install the component
The install command also adds the
@auth0/universal-components-core dependency for shared utilities and Auth0 integration.Configure environment variables
Create a.env file in your project root:Configure Universal Components
ImportAuth0Provider and Auth0ComponentProvider and set interactiveErrorHandler="popup" so that MFA enrollment and deletion challenges are handled in a popup rather than redirecting away from the page.App.tsx
- Users must be authenticated before the My Account components are rendered.
- Components automatically load the logged-in user’s authentication methods from the My Account API.
Learn more
Configure UserMFAMgmt
MFA factors reference: props, customization, TypeScript definitions, and advanced subcomponents.
Configure UserPasskeyMgmt
Passkey management reference: hooks, message overrides, and CSS class targets.