# wallets.createPasskeyRegistrationOptions

> Documentation index: [llms.txt](https://namera.ai/llms.txt).

Source: https://namera.ai/docs/sdk/reference/accounts/create-passkey-registration-options

Start a one-time passkey account registration.

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



## Usage [#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.

<Tabs items={["index.ts", "client.ts"]}>
<Tab value="index.ts">

```ts title="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);
```

</Tab>
<Tab value="client.ts">

```ts title="client.ts"
import { NameraClient } from "@namera-ai/sdk";

export const namera = new NameraClient({
  apiKey: process.env.NAMERA_API_KEY!,
});
```

</Tab>
</Tabs>

## Returns [#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](https://namera.ai/docs/sdk/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.

<div className="docs-response">

```json
{
  "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"
}
```

</div>

## Parameters [#parameters]

### origin [#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.

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

console.log(result.data);
```

### user [#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.

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

console.log(result.data);
```

## Behavior and errors [#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.
