# Registration.getOptions

Returns the creation options for a P256 WebAuthn Credential to be used with the Web Authentication API.

## Imports

:::code-group
```ts [Named]
import { Registration } from 'ox/webauthn'
```

```ts [Entrypoint]
import * as Registration from 'ox/webauthn/Registration'
```
:::

## Examples

```ts twoslash
import { Registration } from 'ox/webauthn'

const options = Registration.getOptions({ name: 'Example' })

const credential =
  await window.navigator.credentials.create(options)
```

## Definition

```ts
function getOptions(
  options: getOptions.Options,
): Types.CredentialCreationOptions
```

**Source:** [src/webauthn/Registration.ts](https://github.com/wevm/ox/blob/main/src/webauthn/Registration.ts#L145)

## Parameters

### options

* **Type:** `getOptions.Options`

Options.

#### options.attestation

* **Type:** `AttestationConveyancePreference`
* **Optional**

A string specifying the relying party's preference for how the attestation statement
(i.e., provision of verifiable evidence of the authenticity of the authenticator and its data)
is conveyed during credential creation.

#### options.authenticatorSelection

* **Type:** `AuthenticatorSelectionCriteria`
* **Optional**

An object whose properties are criteria used to filter out the potential authenticators
for the credential creation operation.

#### options.challenge

* **Type:** `0x${string} | BufferSource`
* **Optional**

An `ArrayBuffer`, `TypedArray`, or `DataView` used as a cryptographic challenge.

#### options.displayName

* **Type:** `string`
* **Optional**

#### options.excludeCredentialIds

* **Type:** `readonly string[]`
* **Optional**

List of credential IDs to exclude from the creation. This property can be used
to prevent creation of a credential if it already exists.

#### options.extensions

* **Type:** `AuthenticationExtensionsClientInputs`
* **Optional**

List of Web Authentication API credentials to use during creation or authentication.

#### options.id

* **Type:** `BufferSource`
* **Optional**

#### options.name

* **Type:** `string`

#### options.rp

* **Type:** `{ id: string; name: string; }`
* **Optional**

An object describing the relying party that requested the credential creation

#### options.timeout

* **Type:** `number`
* **Optional**

A numerical hint, in milliseconds, which indicates the time the calling web app is willing to wait for the creation operation to complete.

#### options.user

* **Type:** `{ displayName?: string; id?: BufferSource; name: string; }`

An object describing the user account for which the credential is generated.

## Return Type

The credential creation options.

`Types.CredentialCreationOptions`
