---
url: /api/kiln/functions/takeSnapshot.md
---
[Kiln API](../../index.md) / [kiln](../index.md) / takeSnapshot

# Function: takeSnapshot()

```ts
function takeSnapshot(app, opts?): Snapshot;
```

Captures entities and trait values. Entities are sorted by id; trait keys by name.

## Parameters

| Parameter | Type |
| ------ | ------ |
| `app` | [`App`](../classes/App.md) |
| `opts` | [`SnapshotOptions`](../interfaces/SnapshotOptions.md) |

## Returns

[`Snapshot`](../interfaces/Snapshot.md)
