# V2 migration guide - Documentation

> For the complete documentation index, see [llms.txt](/llms.txt). Markdown is available with `Accept: text/markdown` and `.md` URL variants.

Source: /docs/guides/sandbox-template-v2-migration-guide

# V2 migration guide

When updating older template examples to the current SDK shape, keep these migrations in mind:

- Prefer the `Template` builder API over ad hoc runtime bootstrapping inside `Sandbox.create(...)`.

- Use `Template.build(...)` to produce a reusable template first, then pass the returned template ID into `Sandbox.create(...)`.

- Move startup logic into `setStartCmd(...)` / `set_start_cmd(...)` so the environment is ready before runtime requests arrive.

- Move repeated package installation and file-copy steps into the template build instead of running them after sandbox launch.

- Use tags for release promotion instead of changing template names for every rollout.

For JavaScript and TypeScript, use the standard ESM import path when working with `Template` in a Node ESM project:

```
import { Template, Sandbox } from "novita-sandbox"
```

This is the currently validated path for the `Template` API in this documentation set.

Last modified on June 4, 2026
