# callbacks.onConfirm

Part of [Callbacks](https://kernstra.com/docs/web-sdk/config/callbacks) in the Kernstra Web SDK 1.0.0 configuration reference.

- Type: `(request: ConfirmRequest) => Promise<boolean> | boolean`
- Page: https://kernstra.com/docs/web-sdk/config/callbacks/onconfirm

Replaces the confirmation dialog ("Delete this page?"). Called in place of the SDK's confirmation dialog, for every question [`confirmations`](https://kernstra.com/docs/web-sdk/config/confirmations) has on, with the words the SDK would have shown (`title`, `message`, `confirmLabel`, `cancelLabel`) and what the action is about (`action`, `count`, `name`). `name` and `message` carry text from the document: show them as text, never HTML. Resolve `true` to go ahead; anything else, and a rejection (logged with `console.warn`), leaves things as they are.

```ts
new PDFViewer(container, doc, {
  callbacks: {
    onConfirm: async ({ action, title, message, confirmLabel, cancelLabel, count, name }) =>
      myDialogs.confirm({ title, body: message, ok: confirmLabel, cancel: cancelLabel, tone: 'danger' }),
  },
});
```

Web page: https://kernstra.com/docs/web-sdk/config/callbacks/onconfirm
