# Authentication.serializeOptions

Serializes credential request options into a JSON-serializable format, converting `BufferSource` fields to base64url strings.

## Imports

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

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

## Examples

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

const options = Authentication.getOptions({
  challenge: '0xdeadbeef'
})

const serialized = Authentication.serializeOptions(options) // [!code focus]

// `serialized` is JSON-serializable — send it to a server, store it, etc.
const json = JSON.stringify(serialized)
```

## Definition

```ts
function serializeOptions(
  options: Types.CredentialRequestOptions,
): Types.CredentialRequestOptions<true>
```

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

## Parameters

### options

* **Type:** `Types.CredentialRequestOptions`

The credential request options to serialize.

## Return Type

The serialized credential request options.

`Types.CredentialRequestOptions<true>`
