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
# npm
npm install @lottiefiles/dotlottie-io
# pnpm
pnpm add @lottiefiles/dotlottie-io
# yarn
yarn add @lottiefiles/dotlottie-ioThe 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 |
const { DotLottie } = require("@lottiefiles/dotlottie-io");Browser (WebAssembly)
Install the same package:
npm install @lottiefiles/dotlottie-ioTwo 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:
// ESM (bundler)
import { init } from "@lottiefiles/dotlottie-io/web";
const { DotLottie, DotLottieBuilder, DotLottieMerger } = await init();<!-- 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 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:
[dependencies]
dotlottie-io = "0.1"Rust usage isn't covered in depth in this documentation — see the dotlottie-io GitHub repository for the Rust API and the native-fs feature flag (streaming, low-memory file I/O).
Verifying Installation
const { DotLottie } = require("@lottiefiles/dotlottie-io");
console.log(typeof DotLottie); // "function"Next up: Quick Start: Creating a .lottie file