@magnaflow/passkey
v1.0.2
Published
Standardized passkey management library for WebAuthn authentication
Maintainers
Readme
@magnaflow/passkey
Browser-side WebAuthn helpers for passkey registration and verification flows.
What It Provides
registerPasskeyto create a passkey credential from server-provided challenge dataverifyPasskeyto complete an authentication challenge- Environment capability checks for WebAuthn and platform authenticators
- Utility helpers for RP ID detection and ArrayBuffer/Base64 conversion
Install
npm install @magnaflow/passkeyKey Exports
registerPasskeyverifyPasskeyisPasskeyAvailablegetRelyingPartyIdarrayBufferToBase64base64ToArrayBufferisWebAuthnSupportedisPlatformAuthenticatorAvailable
Example
import { registerPasskey, verifyPasskey } from '@magnaflow/passkey';
const registerResult = await registerPasskey({
challenge: 'register-challenge',
rp_name: 'MagnaFlow',
user_id: 'merchant-123',
});
const verifyResult = await verifyPasskey({
challenge: 'verify-challenge',
rp_name: 'MagnaFlow',
user_id: 'merchant-123',
registered_ids: ['credential-id-base64'],
});Notes
- This package only performs browser-side WebAuthn work. Backend API requests must be handled by the caller.
- All public APIs in this package require a browser environment.
Development
bunx nx run passkey:lint
bunx nx run passkey:test
bunx nx run passkey:buildLicense
This package is part of the merchant-v2-sdk monorepo and is covered by the root MIT license.
See ../../LICENSE for details.
