# Registration.serializeResponse

Serializes a registration response into a JSON-serializable format, converting `ArrayBuffer` fields to base64url strings and the public key to a hex string.

## 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 credential = await Registration.create({
  name: 'Example'
})
const response = Registration.verify({
  credential,
  challenge: '0x...',
  origin: 'https://example.com',
  rpId: 'example.com'
})

const serialized = Registration.serializeResponse(response) // [!code focus]

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

## Definition

```ts
function serializeResponse(
  response: Registration.Response,
): Response<true>
```

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

## Parameters

### response

* **Type:** [`Registration.Response`](/webauthn/webauthn/Registration/types#registrationresponse)

The registration response to serialize.

#### response.backedUp

* **Type:** `boolean`
* **Optional**

#### response.counter

* **Type:** `number`

#### response.credential

* **Type:** `Credential`

#### response.deviceType

* **Type:** `"multiDevice" | "singleDevice"`
* **Optional**

#### response.userVerified

* **Type:** `true`
* **Optional**

## Return Type

The serialized registration response.

`Response<true>`
