Documentation Index
Fetch the complete documentation index at: https://docs.magic.link/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Passkeys enable passwordless authentication using biometric sensors (such as fingerprints or facial recognition), PINs, or patterns. Built on WebAuthn standards, passkeys provide a more secure and user-friendly alternative to traditional passwords by leveraging public key cryptography. Unlike passwords, passkeys are resistant to phishing, cannot be reused across sites, and never leave the user’s device.Compatibility
Passkey authentication is supported on modern browsers and devices that support WebAuthn. Check browser compatibility for optimal user experience across desktop and mobile devices.
Passkey extension of the Web client-side SDK.
Use Cases
- Passwordless authentication using device biometrics (fingerprint, Face ID)
- Secure multi-device authentication with synced passkeys
- Simplified login flow without remembering passwords
- Enhanced security with phishing-resistant authentication
Usage
Installation
Passkey login works as an extension to Magic SDK. To add Passkey authentication to your Magic integration, start by installing the Passkey Extension:Initialization
Create your Magic SDK instance with the Passkey extension:JavaScript
Register new users
Register new users with theregisterNewUser function in the passkey extension. You can optionally provide a username and nickname:
- username: Used as a display name in the user’s password manager or authenticator
- nickname: Stored by Magic to help identify the passkey among other registered passkeys
JavaScript
Authenticate users
Authenticate users with thelogin method in the passkey extension. The browser will prompt the user to select and verify their passkey:
JavaScript
Return Type
TheregisterNewUser and login methods return a PasskeyResult object:
Get User Metadata
Retrieve passkey-specific metadata with thegetMetadata method in the passkey extension. The response includes information about all devices registered for the current user:
JavaScript