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-io

The correct prebuilt native binary for your platform is selected automatically via optionalDependenciesno build toolchain is required.

Supported platforms

PlatformArchitecture
macOSx64, arm64 (Apple Silicon)
Linuxx64, arm64, armv7 (glibc); x64, arm64 (musl)
Windowsx64, arm64
const { DotLottie } = require("@lottiefiles/dotlottie-io");

Browser (WebAssembly)

Install the same package:

npm install @lottiefiles/dotlottie-io

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

BundleImportUse when
ESM@lottiefiles/dotlottie-io/webVite, webpack, Rollup, or any modern bundler
IIFErelease/browser/dotlottie-io.iife.jsA 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

Last updated: August 5, 2026 at 11:47 AMEdit this page