loginWithPasskey
Log in via a passkey PRF output.
Derives a signature (and owner address) from the PRF value, computes the private keys, runs the pre-login checks, then creates and adds the account.
Import
ts
import { loginWithPasskey } from "@0xcurvy/curvy-sdk/actions";Usage
ts
const account = await loginWithPasskey({ prfValue, credId });Signature
ts
function loginWithPasskey(parameters: LoginWithPasskeyParameters): Promise<CurvyAccount>Returns
Promise<CurvyAccount>
The action resolves or returns the value shown in the signature.
Parameters
prfValue
- Type:
PasskeyPrfValue - Required: yes
The passkey PRF output used to derive the account's Curvy keys.
ts
const result = await loginWithPasskey({
prfValue,
});credId
- Type:
ArrayBuffer - Required: no
The WebAuthn credential identifier associated with the passkey.
ts
const result = await loginWithPasskey({
prfValue,
credId,
});config
- Type:
CurvyConfig - Required: no
Curvy config to use. Defaults to the ambient config.
ts
const result = await loginWithPasskey({
prfValue,
config,
});Errors
Errors from config resolution and the underlying SDK operation are propagated to the caller.
Related
- Authentication guide
login— Log in (add an existing account) from an account signature.loginWithPrivateKeys— Log in from raw spending/viewing private keys.logout— Remove an account and re-point (or clear) the active account.restoreSession— Rehydrate accounts from the browser keystore after a page refresh.