> ## Documentation Index
> Fetch the complete documentation index at: https://docs.layerswap.io/llms.txt
> Use this file to discover all available pages before exploring further.

# onSwapComplete

> Triggered when a swap completes.

`onSwapComplete` fires when the Widget observes the swap reaching `completed`.

```tsx theme={null}
<LayerswapWidget
  config={widgetConfig}
  callbacks={{
    onSwapComplete: (response) => {
      console.log("Swap completed:", response as SwapResponse)
    },
  }}
/>
```

## Callback payload

<Snippet file="snippets/swap-response-types.mdx" />
