Skip to content

feat: add passkey API support for signup and login methods#1114

Open
amitsingh05667 wants to merge 2 commits into
mainfrom
SDK-8775
Open

feat: add passkey API support for signup and login methods#1114
amitsingh05667 wants to merge 2 commits into
mainfrom
SDK-8775

Conversation

@amitsingh05667
Copy link
Copy Markdown
Member

Summary

Adds Passkey API support to auth0-react, making passkey.signup and passkey.login available through the useAuth0 hook.

Changes

  • Added passkey: PasskeyApiClient to Auth0ContextInterface and exposed it via useAuth0
  • Wrapped passkey.signup / passkey.login with state dispatch so isAuthenticated and user update after a successful flow
  • Exported passkey error classes and types from the package root
  • Added 9 tests and updated the Auth0Client mock

Usage

import { useAuth0, PasskeyError } from '@auth0/auth0-react';

function PasskeyButton() {
  const { passkey } = useAuth0();

  const handleSignup = async () => {
    try {
      await passkey.signup({ email: 'user@example.com' });
    } catch (error) {
      if (error instanceof PasskeyError) {
        console.error('Passkey error:', error.message);
      }
    }
  };

  const handleLogin = async () => {
    await passkey.login({ scope: 'openid profile email' });
  };

  return (
    <>
      <button onClick={handleSignup}>Sign up with Passkey</button>
      <button onClick={handleLogin}>Sign in with Passkey</button>
    </>
  );
}

@amitsingh05667 amitsingh05667 requested a review from a team as a code owner June 3, 2026 05:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant