E2B templates allow you to define custom sandboxes.
You can define the base image, environment variables, files to copy, commands to run, and
a start command that will be already running when you spawn the sandbox.
This way, you can have fully configured sandboxes with running processes ready to use with zero wait time for your users.There are two ways how you can start creating a new template:
import "dotenv/config";import { Sandbox } from "e2b";// Create a Sandbox from development templateconst sandbox = await Sandbox.create("template-tag-dev");// Create a Sandbox from production templateconst sandbox = await Sandbox.create("template-tag");
The template alias is the identifier that can be used to create a new Sandbox.