# Installation
Learn how to install dotlottie-io using npm, pnpm, or yarn, for both Node.js and browser (WebAssembly) projects.

# Installing dotlottie-io

`dotlottie-io` is published as a single npm package that works in both Node.js and the browser.

## Node.js

```bash
# npm
npm install @lottiefiles/dotlottie-io

# pnpm
pnpm add @lottiefiles/dotlottie-io

# yarn
yarn add @lottiefiles/dotlottie-io
```

The correct prebuilt native binary for your platform is selected automatically via `optionalDependencies` — **no build toolchain is required**.

**Supported platforms**

| Platform | Architecture                                 |
| -------- | -------------------------------------------- |
| macOS    | x64, arm64 (Apple Silicon)                   |
| Linux    | x64, arm64, armv7 (glibc); x64, arm64 (musl) |
| Windows  | x64, arm64                                   |

```javascript
const { DotLottie } = require("@lottiefiles/dotlottie-io");
```

## Browser (WebAssembly)

Install the same package:

```bash
npm install @lottiefiles/dotlottie-io
```

Two prebuilt bundles are included — pick whichever fits your setup:

| Bundle | Import                                 | Use when                                     |
| ------ | -------------------------------------- | -------------------------------------------- |
| ESM    | `@lottiefiles/dotlottie-io/web`        | Vite, webpack, Rollup, or any modern bundler |
| IIFE   | `release/browser/dotlottie-io.iife.js` | A vanilla `<script>` tag, no build step      |

Unlike Node.js, the browser build must be **initialized** before its classes are usable:

```javascript
// ESM (bundler)
import { init } from "@lottiefiles/dotlottie-io/web";

const { DotLottie, DotLottieBuilder, DotLottieMerger } = await init();
```

```html
<!-- IIFE (vanilla script tag) -->
<script src="node_modules/dotlottie-io/release/browser/dotlottie-io.iife.js"></script>
<script>
  (async () => {
    const { DotLottie, DotLottieBuilder, DotLottieMerger } = await DotLottieIO.init();
  })();
</script>
```

See [Platform Notes](/docs/tools/dotlottie-io/guides/platform-notes) for the full ESM vs. IIFE walkthrough and how to override the WASM source URL.

## Rust

`dotlottie-io` is also usable directly as a Rust crate:

```toml
[dependencies]
dotlottie-io = "0.1"
```

Rust usage isn't covered in depth in this documentation — see the [dotlottie-io GitHub repository](https://github.com/lottiefiles/dotlottie-io) for the Rust API and the `native-fs` feature flag (streaming, low-memory file I/O).

## Verifying Installation

```javascript
const { DotLottie } = require("@lottiefiles/dotlottie-io");
console.log(typeof DotLottie); // "function"
```

Next up: [Quick Start: Creating a .lottie file](/docs/tools/dotlottie-io/getting-started/creating)
