/** * Whether a passkey credential can be backed up and synced across multiple devices (e.g. via iCloud Keychain or * Google Password Manager), or is bound to a single physical authenticator and cannot be synced */ export declare enum DeviceType { SINGLE_DEVICE = "SINGLE_DEVICE", MULTI_DEVICE = "MULTI_DEVICE" } /** * How an authenticator is connected to the client device during a WebAuthn ceremony */ export declare enum AuthenticatorAttachment { PLATFORM = "platform",// The authenticator is built into the client device (e.g. Touch ID, Windows Hello) CROSS_PLATFORM = "cross-platform" } /** * A transport an authenticator supports for communicating with the client device */ export declare enum AuthenticatorTransport { BLE = "ble",// Bluetooth Low Energy CABLE = "cable",// Cloud-assisted Bluetooth Low Energy (caBLE) HYBRID = "hybrid",// A client device (e.g. a phone) reachable via QR code and BLE pairing INTERNAL = "internal",// The authenticator is part of the client device itself (platform authenticator) NFC = "nfc",// Near Field Communication SMART_CARD = "smart-card",// Smart Card USB = "usb" } /** * Public representation of a passkey registered by a user. Never includes the credential's public key or signature counter */ export interface Passkey { credentialId: string; name: string; deviceType?: DeviceType; createDate: number; lastUsedDate?: number; } /** * The relying party a new passkey is being registered for */ export interface PasskeyRelyingParty { id: string; name: string; } /** * The user a new passkey is being registered for */ export interface PasskeyUser { id: string; name: string; displayName: string; } /** * References an existing credential, used to either exclude it from a new registration or allow it for authentication */ export interface PasskeyCredentialDescriptor { id: string; transports?: AuthenticatorTransport[]; } /** * A public key algorithm accepted for a new credential */ export interface PasskeyPubKeyCredParam { alg: number; type: "public-key"; } /** * Constraints the relying party places on which authenticators may be used and how they must behave during registration */ export interface PasskeyAuthenticatorSelection { authenticatorAttachment?: AuthenticatorAttachment; residentKey?: string; requireResidentKey?: boolean; userVerification?: string; } /** * Options returned by the server to create a new passkey with an authenticator */ export interface PasskeyRegistrationOptions { rp: PasskeyRelyingParty; user: PasskeyUser; challenge: string; pubKeyCredParams: PasskeyPubKeyCredParam[]; timeout?: number; excludeCredentials?: PasskeyCredentialDescriptor[]; authenticatorSelection?: PasskeyAuthenticatorSelection; attestation?: string; extensions?: Record; } /** * Options returned by the server to authenticate with an existing passkey */ export interface PasskeyAuthenticationOptions { challenge: string; timeout?: number; rpId?: string; allowCredentials?: PasskeyCredentialDescriptor[]; userVerification?: string; extensions?: Record; } /** * The authenticator's response produced during passkey registration */ export interface PasskeyAttestationResponse { clientDataJSON: string; attestationObject: string; authenticatorData?: string; transports?: AuthenticatorTransport[]; publicKeyAlgorithm?: number; publicKey?: string; } /** * The credential produced by the browser during passkey registration (the value returned by `navigator.credentials.create()`), * together with a label for the new passkey. */ export interface PasskeyRegistrationCredential { id: string; rawId: string; response: PasskeyAttestationResponse; authenticatorAttachment?: AuthenticatorAttachment; clientExtensionResults: Record; type: "public-key"; name: string; } /** * The authenticator's response produced during passkey authentication * (part of the value returned by `navigator.credentials.get()`) */ export interface PasskeyAssertionResponse { clientDataJSON: string; authenticatorData: string; signature: string; userHandle?: string; } /** * The credential produced by the browser during passkey authentication (the value returned by `navigator.credentials.get()`) */ export interface PasskeyAuthenticationCredential { id: string; rawId: string; response: PasskeyAssertionResponse; authenticatorAttachment?: AuthenticatorAttachment; clientExtensionResults: Record; type: "public-key"; }