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
| Tool | Why you need it |
|---|---|
| A command line (Terminal, PowerShell, etc.) | Running npm/npx commands |
| Git | Checking out PhET's source repositories if you ever need to patch a library — see Modifying SceneryStack |
| Node.js and npm | Installing 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.
Scaffolding a new project (recommended)
The fastest way to start a new simulation or application is the official scaffolding tool:
npm create scenerystack@latestThis walks you through:
- naming the project (it creates a directory with that name)
- choosing a bundler — Vite, Webpack, Esbuild, or Parcel
- whether to set up ESLint and Prettier
...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:
npm install scenerystackThen import from the subpath for whichever library you need — scenerystack is not meant to be imported from its bare package root:
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
- Your First Simulation — build a minimal one-screen
Sim - Scenery Application vs. Standalone Library — decide whether you even need
Sim - Project Structure Conventions — how a SceneryStack repo is usually laid out
- Supported Browsers — the platform support matrix to design against