Skip to content

Installation and Setup

SceneryStack is a TypeScript framework, published as a single npm package. Before writing any code you need Node.js, npm, and (for cloning the underlying libraries) Git — everything else is standard JavaScript tooling.

Prerequisites

ToolWhy you need it
A command line (Terminal, PowerShell, etc.)Running npm/npx commands
GitChecking out PhET's source repositories if you ever need to patch a library — see Modifying SceneryStack
Node.js and npmInstalling dependencies and running the dev server/build

SceneryStack is a TypeScript library: it can be consumed from plain JavaScript, but its options objects rely entirely on compile-time types rather than runtime checks, so TypeScript is strongly recommended. Any editor with good TypeScript support works well — VS Code and WebStorm are the two most commonly used by SceneryStack maintainers.

The fastest way to start a new simulation or application is the official scaffolding tool:

bash
npm create scenerystack@latest

This walks you through:

...and prints the exact commands to install dependencies and open the running project in your browser. See Your First Simulation for what the generated code looks like, and Running and Building a Simulation for the dev-server/build workflow it wires up.

Adding SceneryStack to an existing project

If you already have a bundler-based project and just want the library:

bash
npm install scenerystack

Then import from the subpath for whichever library you need — scenerystack is not meant to be imported from its bare package root:

ts
import { Node, Text } from 'scenerystack/scenery';
import { Property } from 'scenerystack/axon';

Import from subpaths, not the package root

Every SceneryStack library — axon, dot, kite, scenery, sun, scenery-phet, joist, sim, tandem, phetcommon, and others — is its own subpath export (scenerystack/<library>). There is no flat scenerystack import; see What is SceneryStack? for the full library table.

Where to go next