Skip to main content
This guide will help you set up your local development environment for contributing to the Sentry JavaScript SDK monorepo.

Prerequisites

Volta

We use Volta to ensure consistent versions of Node.js, Yarn, and pnpm across all contributors. Volta automatically manages the correct versions based on the volta field in package.json. Install Volta:
For more installation options, see the Volta documentation.

Enable pnpm Support

Make sure to enable pnpm support in Volta if you want to run the E2E tests locally:
Add this to your shell configuration file (.bashrc, .zshrc, etc.) to make it permanent.

Python

Due to package incompatibilities, building native binaries currently requires Python version < 3.12.

Initial Setup

Once you have the prerequisites installed, clone the repository and install dependencies:
The initial build is important because it:
  • Transpiles TypeScript code to JavaScript
  • Generates type definitions
  • Links packages together in the monorepo
  • Ensures TypeScript can read all linked type definitions
With that, the repo is fully set up and you are ready to run all commands.

Monorepo Structure

The Sentry JavaScript SDK is a monorepo containing 40+ packages, managed with Yarn workspaces and Nx.

Workspace Configuration

All workspaces are defined in the root package.json:workspaces field:

Version Management

Volta pins specific versions in package.json:
Never change Volta, Yarn, or package manager versions unless explicitly asked or approved by the core team.

Verifying Your Setup

After completing the initial setup, verify everything is working:
If you see the build/ directory with cjs/, esm/, and types/ subdirectories, and tests pass, your environment is ready!

Next Steps

Now that your environment is set up, you can: