# server.Server.daemonIdentity

- **Module:** server
- **Package:** libtmux
- **Language:** TypeScript
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-ts/blob/073b9d7dedad900bff6f5ec0ea47794e40225870/packages/libtmux/src/server.ts#L973
- **Page:** https://libtmux.org/en/ts/latest/reference/server-server-daemonidentity/

```
async daemonIdentity(
  options: SnapshotOptions = {},
): Promise<DaemonIdentity>
```

Which daemon is answering on this socket right now.

A socket path names a place, not a process. [`kill-server`](/en/tmux/latest/manual/kill-server/) followed by a
restart puts a different daemon at the same path, and that daemon numbers
its panes from `%0` again — so a handle held across the restart names an
object that no longer exists, at an id something else now has. Comparing
this before and after is how a long-running caller can tell.

A reachable daemon reports its identity even when it has no sessions. An
unreachable server rejects instead of returning an absent identity.

## Examples

```ts
const before = await server.daemonIdentity();
const after = await server.daemonIdentity();
before.pid === after.pid;
```

## Parameters

- `options` (`SnapshotOptions`)
  Default: `{}`.
