SDK Templates
All sandboxes created by the CodeSandbox SDK are created from a template. Even if you don't pass an argument to sdk.sandboxes.create
, we will fork the "Universal" template to create a new sandbox for you.
Technically we are forking a snapshot, a hibernated Sandbox. This concept of forking is part of the core foundation of CodeSandbox. It allows you to create a Sandbox that contains all your necessary dependencies, files, or even running servers and then clone it as many times as you would like to create new sandboxes.
Starting from a Template
You can start from a template by passing the template id to the sdk.sandboxes.create
method.
const sandbox = await sdk.sandboxes.create({
source: 'template',
id: 'some-template-id'
})
Official Templates
Below are the official templates on CodeSandbox that you can start experimenting with. You can click on the id on the right to copy the id to your clipboard and use it in your sandbox. Click on the title to open the template in the CodeSandbox editor to inspect it:
Want to create your own template? Check out the Templates guide to learn how to create one from your own files using a CLI.