You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/projects-docs/pages/sdk/index.mdx
+24-23Lines changed: 24 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,42 +8,43 @@ import { Callout } from 'nextra-theme-docs'
8
8
9
9
<Hero
10
10
title="CodeSandbox SDK"
11
-
subtitle="Programmatically spin up (AI) sandboxes"
11
+
subtitle="Programmatically spin up development environments"
12
12
/>
13
13
14
14
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.
16
16
17
-
## Use Cases
17
+
## Quickstart
18
18
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)
20
20
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.
24
22
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:
26
24
27
-
### AI Agents
25
+
```bash
26
+
npm install @codesandbox/sdk
27
+
```
28
28
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:
30
30
31
-
### Development environments
31
+
```js
32
+
import { CodeSandbox } from"@codesandbox/sdk";
32
33
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
+
constsdk=newCodeSandbox();
35
+
constsandbox=awaitsdk.sandboxes.create();
36
+
constclient=awaitsandbox.connect();
34
37
35
-
With the SDK, you can essentially create your own CodeSandbox for your team/company/school!
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
40
44
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:
42
46
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
0 commit comments