For AI agents: read the documentation index. Documentation pages are available as Markdown by appending .md to their URL, or requesting Accept: text/markdown.

Namera Docs

wallets.createPasskeyRegistrationOptions

Start a one-time passkey account registration.

namera.wallets.createPasskeyRegistrationOptions() start a one-time passkey account registration.

Usage

Install @namera-ai/sdk and set NAMERA_API_KEY on your backend. IDs and responses below are illustrative fixtures; replace IDs with your own resources.

index.ts
import { namera } from "./client";
const result = await namera.wallets.createPasskeyRegistrationOptions({
  origin: "https://app.example.com",
  user: { name: "Customer", displayName: "Customer" },
});
if (!result.success) throw new Error(result.error.message);

console.log(result.data);

Returns

API methods return a Promise<NameraResult<T, E>>. When success is true, data contains the value described below and error is null. On failure, data is null and error describes the failure.

The JSON example shows the complete successful data, with illustrative values. Date-time values use ISO strings in JSON; bigint values use decimal strings. See Handling Results and Errors for the error shape.

Returns verificationId, browser-ready WebAuthn options, and expiresAt. The credential’s allowed origin determines the RP ID.

{
  "verificationId": "0199dfe1-0000-7000-8000-000000000022",
  "options": {
    "challenge": "OuAZdeWe1cPGP8if-E91tdEwtCgFVy68KEuEyXdtaIY",
    "rp": {
      "id": "app.example.com",
      "name": "Namera"
    },
    "user": {
      "id": "MDFhMTNkNmQtNzZkYi03NTUzLWE4M2QtMTFhMzRkNWJhNjFm",
      "name": "Customer",
      "displayName": "Customer"
    },
    "pubKeyCredParams": [
      {
        "alg": -7,
        "type": "public-key"
      }
    ],
    "timeout": 300000,
    "excludeCredentials": [],
    "authenticatorSelection": {
      "residentKey": "required",
      "requireResidentKey": true,
      "userVerification": "required"
    },
    "hints": [],
    "attestation": "none",
    "extensions": {
      "credProps": true
    }
  },
  "expiresAt": "2026-10-15T02:44:06.347Z"
}

Parameters

origin

Type: string. Required. Exact origin of the application where the browser creates the credential. A human must approve it in this API key’s passkey-origin allowlist when issuing the key. HTTPS is required except HTTP localhost/127.0.0.1 development origins. Paths, query strings, fragments, and credentials are rejected.

index.ts
import { namera } from "./client";
const result = await namera.wallets.createPasskeyRegistrationOptions({
  origin: "https://app.example.com", 
  user: { name: "Customer", displayName: "Customer" },
});
if (!result.success) throw new Error(result.error.message);

console.log(result.data);

user

Type: object. Required. Application user labels for the browser prompt. name and displayName must be nonempty strings. These labels are not Namera membership or authorization. Your backend must bind the ceremony to its own authenticated application user.

index.ts
import { namera } from "./client";
const result = await namera.wallets.createPasskeyRegistrationOptions({
  origin: "https://app.example.com",
  user: { name: "Customer", displayName: "Customer" }, 
});
if (!result.success) throw new Error(result.error.message);

console.log(result.data);

Behavior and errors

Requires wallet:create and an allowlisted origin. Keep the API key on your backend; send only the registration options to the browser. Ceremonies from the same API key are independent, so multiple application users can register concurrently. Registration preparation is not automatically retried. The response does not create an account; submit the browser response through wallets.create(). Never accept an arbitrary verification ID from a different application user.