# server.ServerOptions.onInvocation

- **Module:** server.ServerOptions
- **Package:** libtmux
- **Language:** TypeScript
- **Kind:** property
- **Source:** https://github.com/libtmux/libtmux-ts/blob/3fe1ca654b81b8cbf4a13b777a001a3298c87a6f/packages/libtmux/src/server.ts#L154
- **Page:** https://libtmux.org/en/ts/latest/reference/server-serveroptions-oninvocation/

Called once per tmux invocation, after it answers or fails.

The seam for logs, traces and metrics. Every command this server runs
reports here, a custom engine's included, and an observer cannot change
what a command does — see {@link TmuxInvocationObserver}.

## Example

```ts
const traced = new Server({
  onInvocation: (report) => {
    console.log(report.commands[0]?.[0], report.durationMs, report.delivery);
  },
});
```
