Skip to content

Commit 290115f

Browse files
new front
1 parent 534e10a commit 290115f

3 files changed

Lines changed: 24 additions & 60 deletions

File tree

packages/projects-docs/pages/sdk/_meta.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"index": "Introduction",
3-
"quickstart": "Quickstart Guide",
43
"key-terms": "Key Terms",
54
"core-concepts": "Core Concepts",
65
"faq": "FAQ",

packages/projects-docs/pages/sdk/index.mdx

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,42 +8,43 @@ import { Callout } from 'nextra-theme-docs'
88

99
<Hero
1010
title="CodeSandbox SDK"
11-
subtitle="Programmatically spin up (AI) sandboxes"
11+
subtitle="Programmatically spin up development environments"
1212
/>
1313

1414
CodeSandbox SDK enables you to quickly create and run isolated sandboxes securely.
15-
The SDK can be used to run concurrent VMs to support multiple use cases such as browser editors, AI agents, code interpretation and [more](/sdk/use-cases.mdx)
15+
The SDK can be used to run concurrent VMs to support multiple use cases such as browser editors, AI agents, code interpretation and more.
1616

17-
## Use Cases
17+
## Quickstart
1818

19-
CodeSandbox SDK is designed to help you build and launch any projects that require:
19+
1. Create or log into your [CodeSandbox account](https://codesandbox.io/signin)
2020

21-
- An isolated code interpreter.
22-
- Running multiple development environments at scale.
23-
- Access to a sandboxed environment.
21+
2. Next create an API key at [https://codesandbox.io/t/api](https://codesandbox.io/t/api), and enable all scopes. Expose it as `CSB_API_KEY` in your environment.
2422

25-
There are hundreds of use cases that can benefit from these three features. Below are some of the most interesting ones we've come across so far:
23+
3. Install the SDK:
2624

27-
### AI Agents
25+
```bash
26+
npm install @codesandbox/sdk
27+
```
2828

29-
Agentic workflows are a fast-emerging use case that benefit immensely from CodeSandbox SDK. Using the SDK, You can give each agent a sandbox to resolve user prompts, or you can create autonomous agents running on sandboxes. Doing this ensures they are securely isolated from your system, while still allowing them to interact with each other as required. You can also run multiple agents in parallel, if you want to avoid interaction entirely. Using the forking mechanism, you can also A/B test different agents.
29+
Your first interaction:
3030

31-
### Development environments
31+
```js
32+
import { CodeSandbox } from "@codesandbox/sdk";
3233

33-
You can use the SDK to programmatically provision a sandbox for anybody who needs an environment to code. Allowing you to run multiple development environments in parallel without them interfering with each other, all accessible through the browser.
34+
const sdk = new CodeSandbox();
35+
const sandbox = await sdk.sandboxes.create();
36+
const client = await sandbox.connect();
3437

35-
With the SDK, you can essentially create your own CodeSandbox for your team/company/school!
38+
const output = await client.commands.run("echo 'Hello World'");
3639

37-
### Code Interpretation
40+
console.log(output) // Hello World
41+
```
3842

39-
CodeSandbox SDK allows programmatically spinning up sandboxes (VMs) to execute code in. Providing an ideal environment to interpret code, for both for simple and complex tasks.
43+
## How to integrate
4044

41-
As these sandboxes exist in total isolation, you can run untrusted code without worrying about it affecting your system.
45+
To understand how the SDK can be integrated into your product it is critical that you read the following pages:
4246

43-
Many early adopters, such as Blackbox AI, are leveraging the power of CodeSandbox SDK to bring code interpretation capabilities to their generative AI applications. We highly recommend following the [guide by Together AI](https://docs.together.ai/docs/together-code-sandbox) to get CodeSandbox SDK running seamlessly with any of the leading open-source LLMs.
44-
45-
### CI/CD
46-
47-
With the SDK, you can set up your own CI/CD implementation to run tests inside a sandbox and hibernate the sandbox when the tests are done. With our snapshotting technology, you can quickly pick up where you left off if you start the sandbox again to re-run your tests or evaluate the results.
48-
49-
You can also use the SDK to create 1 sandbox that runs your CI/CD preparation, and then clone it multiple times to run your tests in parallel.
47+
- [**Core Concepts**](/sdk/core-concepts.mdx): It is all about templates, persistence and lifecycles
48+
- [**Templates**](/sdk/templates.mdx): Drop your end users directly into an optimized running Sandbox
49+
- [**Lifecycle Management**](/sdk/manage-sandboxes.mdx): Learn about managing cost VS optimizing UX
50+
- [**Hosts**](/sdk/sandbox-hosts.mdx): Learn about creating an experience around the ports you want to expose from Sandboxes

packages/projects-docs/pages/sdk/quickstart.mdx

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)