> This page is for Server SDKs.

> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes.

# register

> Record what a handoff nonce gives access to.

[handoffrouter]: /docs/server-sdks/reference/typescript/agents/handoff-router

[readhandle]: /docs/server-sdks/reference/typescript/agents/chat-gateway/read-handle

[redeem]: /docs/server-sdks/reference/typescript/agents/handoff-router/redeem

Records which conversation and call a nonce belongs to. Call it from the per-call config callback of
the dial that carried the nonce, with `callId` from the request the platform sent, never from
anything the browser supplied.

Registering a nonce that's already in the table changes nothing, because the callback runs on every
config request for the call. The first registration's call, time, and message count stand, and a
nonce [`redeem()`][redeem] has used stays used until it would have expired. An empty or non-string
nonce is ignored.

## Parameters

**`nonce`** `string` — required

The nonce put in the dial's user variables.

---

**`opts`** `{ conversationId: string; callId?: string | null }` — required

What the nonce gives access to.

---

**`opts.conversationId`** `string` — required

The conversation the call belongs to.

---

**`opts.callId`** `string | null`

The platform call id. Without one, `/handoff` has no call to end and `/say` has no call to speak
into.

---

## Returns

`void`.

## Examples

```typescript
import { ChatGateway, HandoffRouter } from '@signalwire/sdk';

const gateway = new ChatGateway({ configUrl: 'https://bayview-taxi.example.com/dispatch' });
const handoff = new HandoffRouter({ gateway });

// From the per-call config callback of the dial that carried the nonce.
handoff.register('n_7f3a91c2', {
  conversationId: 'chat-8f21',
  callId: 'b2c0f1e4-5a6d-4f0e-9d1b-3c7e8a9f0b12',
});
```