Skip to main content



The @turnkey/webauthn-stamper package is used for stamping requests made to Turnkey's API with WebAuthn credentials, but specifically for use with passkeys.

For more information on passkeys and WebAuthn refer to this section.


To get started install the @turnkey/webauthn-stamper client.

npm i @turnkey/webauthn-stamper


The WebauthnStamper class is a utility designed to facilitate the process of creating a digital stamp using WebAuthn credentials. This stamp is essential for authenticating requests made to a web server or API that utilizes WebAuthn for secure, passwordless authentication. You can initialize a new WebauthnStamper using the WebauthnStamper constructor:

constructor(config: TWebauthnStamperConfig): WebauthnStamper


An object containing configuration settings for the stamper.


The RPID ("Relying Party ID") for your origin. For an origin named, the RPID is typically If you're testing on localhost, the RPID should be localhost.


The time in milliseconds before the stamp request times out. Defaults to 300000 milliseconds (5 minutes) if not specified.

Specifies the user verification requirements. Can be set to values like required, preferred, or discouraged. Defaults to preferred if not provided.

An array of credential descriptors specifying the credentials to be allowed during authentication. This is optional and defaults to an empty array.


type TWebauthnStamperConfig = {
rpId: string;
timeout?: number;
userVerification?: UserVerificationRequirement;
allowCredentials?: PublicKeyCredentialDescriptor[];
type UserVerificationRequirement = "discouraged" | "preferred" | "required";

Refer to our guide on using passkeys for more information on this type and its usage.

interface PublicKeyCredentialDescriptor {
id: BufferSource;
transports?: AuthenticatorTransport[];
type: PublicKeyCredentialType;

Refer to our guide on using passkeys for more information on this type and its usage.


import { WebauthnStamper } from "@turnkey/webauthn-stamper";
import { TurnkeyClient } from "@turnkey/http";

const stamper = new WebAuthnStamper({
rpId: "",

// New HTTP client able to sign with passkeys!
const httpClient = new TurnkeyClient(
{ baseUrl: "" },


stamp: (input: string) => Promise<TStamp>

Creates a digital stamp, which includes the public key, signature scheme, and a signature based on WebAuthn credentials.



The Turnkey activity request, or query to be sent to Turnkey's API.


type TStamp = {
stampHeaderName: string;
stampHeaderValue: string;