Dependencies Required to Run Matter.js

This article explains the runtime requirements and optional dependencies needed to use Matter.js in web and server-side environments. While Matter.js is fundamentally a standalone, zero-dependency 2D physics engine, certain advanced features and platform-specific implementations rely on optional external libraries and environment-specific APIs to function properly.

Core Engine Dependencies

The core Matter.js engine has zero external runtime dependencies. It is packaged as a completely self-contained JavaScript library. To run basic rigid body simulations, collision detection, and constraint resolution, you only need an environment capable of executing modern JavaScript (ECMAScript 5 or higher).

Environment Requirements

Optional Dependencies for Advanced Features

While the engine does not require dependencies for standard primitives (rectangles, circles, and convex polygons), two external libraries are required for specialized geometry: