# The Manifest
Understand the manifest.json entry in a .lottie package, the initial animation/state machine, and v1 vs v2 path layouts.

# The Manifest

Every `.lottie` package contains a `manifest.json` entry describing its contents — the list of animations, themes, and state machines, plus which one (if any) a player should load first.

## Reading the manifest

```javascript
dotlottie.getManifestJson(); // → string
```

Returns the full manifest as a JSON string. Parse it with `JSON.parse()` to inspect its fields directly, or use the more targeted methods below.

## Setting the initial animation or state machine

```javascript
dotlottie.setInitial("hero", null); // load "hero" first, no state machine
dotlottie.setInitial(null, "sm-button"); // load the "sm-button" state machine first
dotlottie.setInitial(null, null); // clear both
```

```javascript
dotlottie.getInitialAnimationId(); // → string | null
dotlottie.getInitialAnimation(); // → string | null (the Lottie JSON itself)
```

## v1 and v2 archive layouts

`dotlottie-io` reads both dotLottie archive layouts, but **always writes v2**:

| Content       | v2 path        | Legacy v1 path         |
| ------------- | -------------- | ---------------------- |
| Animation     | `a/{id}.json`  | `animations/{id}.json` |
| Image         | `i/{filename}` | `images/{filename}`    |
| Audio         | `u/{filename}` | `audio/{filename}`     |
| Theme         | `t/{id}.json`  | — (v2 only)            |
| State machine | `s/{id}.json`  | — (v2 only)            |

Themes and state machines don't exist in the v1 layout — they're a v2-only addition. When you load a v1 file with `DotLottie.fromFile`/`fromBytes`, its manifest is normalized to `version: "2"` on read, and any `.lottie` you write back out (via `toBytes`) is always in the v2 layout, regardless of what you loaded.

Next up: [Migrating from dotlottie-js](/docs/tools/dotlottie-io/guides/migrating-from-dotlottie-js)
