New

CodeSandbox is now part of Together AI! We have joined forces to launch CodeSandbox SDK and bring code interpretation to generative AI.

Learn more

Changelog

commit
CodeSandbox SDK RC

CodeSandbox SDK RC

We are back with a major update to CodeSandbox SDK, which we're officially announcing soon.

Hello there 👋

We've been hard at work over the past few months building the new CodeSandbox SDK to allow you to use CodeSandbox infrastructure and features in new and exciting ways.

We'd like to take this opportunity to thank you, our early adopters. You've provided us with your detailed feedback, worked with us to debug problems and more broadly, you've stuck with us!

As the SDK has matured, a common theme in your feedback has been that the API hasn't been as intuitive as you and we would like it to be. This release candidate includes a comprehensive overhaul of the surface API to make it more accessible, consistent and also make it easier for us to support more features in the future.

We encourage you to read through the RC Docs and use the shiny new playground to test some of these new features (playground sneak peek below).

Try the new SDK now: npm install @codesandbox/sdk@rc


Mental model

Before we jump into the new features, let's do a quick recap of the mental model to use the new SDK:

// Management of all resources
const sdk = new CodeSandbox();
 
// Management of preview tokens
sdk.previewTokens;
 
// Management of sandboxes
sdk.sandboxes;

For sandbox resources, the mental model is:

// Manage sandboxes without a session
sdk.sandboxes.create();
sdk.sandboxes.resume("sandbox-id");
sdk.sandboxes.restart("sandbox-id");
sdk.sandboxes.shutdown("sandbox-id");
sdk.sandboxes.hibernate("sandbox-id");
 
// Create a session to interact
sandbox.connect();
sandbox.createBrowserSession();
sandbox.createRestSession();

What's new?

+-3

Support for environment variables 🔑

This has been one of the top-requested features for quite a while! Now, the SDK has support for environment variables for your sessions, bound to any command or terminal instances created.

+-3

Select a git source ✔️

You can now select a git source for a Sandbox, which allows you to clone a repo.

+-3

Preview API 📺

Our new Preview API allows you to interact with the preview iFrame in the browser. You can try this now on our playground!

+-3

Automatic reconnect handling 🔄️

The browser connection to a Sandbox now has automatic reconnect handling.

+-3

Snapshots deployed to all clusters 🌐

Now, when you build templates using the CLI, we will deploy the snapshots to all our clusters. Below you can see an example where the snapshot was deployed to our fc-eu-2 and fc-us-1 clusters (several additional clusters are available).

Snapshots deployed to all clusters

Other New Features & Improvements

+-3

Tasks are now enhanced with features to manage the task and open its shell output.

+-3

You can now pass Git credentials to a session to manage git in a Sandbox.

CodeSandbox SDK Breaking Changes

If you are moving from 0.12.x to the release candidate, it can be a good idea to read through the docs, as there are several surface API changes. The most noticeable are:

  • shells are removed in favor of higher dedicated abstractions called terminals, commands , interpreters , setup and tasks . They all abstract the lower-level shell with accessible methods and behaviors for consuming the underlying shells.
  • Separation of Sandbox instance and Sessions.


And there you have it!

We hope you're as excited as we are about all these updates, especially as we get closer to a full release.

Thank you again for continuing to share your feedback with us to help us make the SDK better for everyone.

Have fun building and see you soon 👋

commit
Private preview support, auto-wake & CodeSandbox SDK improvements
commit
CodeSandbox SDK sessions API, list running sandboxes & many improvements
commit
Joining Together AI, launching CodeSandbox SDK & tons of improvements
commit
New Status Page, Sandpack Accessibility Improvements and Tons of Fixes
commit
New Template Picker, Sandpack Static File Support and Several Improvements
commit
New Editor Powered by Web VS Code, Test Runner, and Several Improvements
commit
Web VS Code Beta and Several Improvements
commit
Storybook Add-on, SOC 2, Unlimited Public Sandboxes and more
commit
VS Code Web, Extension Marketplace and Dashboard Updates
commit
New Repo Import Flow, Annual Plans, Better AI and UX Improvements
commit
VM Resizing and Dashboard & Editor Improvements
commit
CodeSandbox CDE, Usage-based Billing, and Live Sessions
commit
Unified Platform, Codeium and VS Code editor
commit
Enterprise, Dev Containers, GPT-4 and VS Code extension update
commit
AI Commit Messages 2.0, new command palette and more
commit
SSO, VIM mode, dependency picker and Chrome DevTools
commit
Code reviews, editor updates and custom themes
commit
Boxy AI assistant, Go support, VS Code overhaul, and editor updates
commit
PHP support, faster microVMs and better stability
commit
Seamless branching, workspace scopes, Python support and many more
commit
Docker support, Rust, seamless branching and much more
commit
Cloud Sandboxes for iOS & VS Code, new onboarding and more
commit
New dashboard, repositories and cloud sandboxes
commit
The realtime multiclient collaboration update
commit
GitHub App updates, better Astro support and a new login method
commit
VS Code Insider support, faster project imports and much more
commit
Sandpack meets Dracula, support for custom NPM registries and bug fixes
commit
Better list-view and rename branches from the command palette
commit
Public beta, new documentation and GiHub App
commit
Always on previews, VScode improvements and better UI consistencies.
commit
Sandpack June Update
commit
Binary files on mobile, more syntax highlights and repository renames.
commit
Drag and drop file upload, better framework support and more.
commit
Firecracker by default, more storage and more FPS.
commit
Sandpack April & May Update
commit
Protected branches, bulk discard and relative file path.
commit
CodeSandbox May Update
commit
Sandpack March Update
commit
Announcing CodeSandbox Projects
commit
Sandpack February Update
commit
Meet the new CodeSandbox
commit
Sandpack January Update
commit
Sandpack Devtools have landed
commit
Welcome to our release notes