Used together, in direct response to a real user tap — see Core Concepts → Passkey-first & smart fallback for the full three-state model these two complete.
Generated directly from @threshold1/auth@0.3.0 — the real, currently-installed package, not hand-typed. Regenerated on every build; if this page and the actual SDK ever disagree, the SDK is right and this page needs a rebuild, not an edit.
confirmDeviceSend(): Promise<{
maskedIdentifier: string;
}>;
State B, step 2: send a code to the recognized device's enrolled
fallback identifier. Only call this in direct response to the user
tapping a confirm UI you showed after login() returned
{ status: "confirm_required", maskedIdentifier } — never call it
automatically.
Promise<{
maskedIdentifier: string;
}>
The masked identifier the code was sent to, e.g. "h••••••@gmail.com"
if there is no recognized device (call login() first)
verifyDeviceCode(code): Promise<UserProfile>;
State B, step 3: verify the code the user entered after confirmDeviceSend(). The real identifier is never sent to or known by the client — resolved server-side from the device token alone.
Fires auth.onAfterAuth("otp") on success, like every other successful auth path.
string
The 6-digit code entered by the user
Promise<UserProfile>
The authenticated user profile
if there is no recognized device
type DeviceRecognitionCheckResult =
| {
state: "A";
}
| {
channel: "otp";
maskedIdentifier: string;
state: "B";
};