@lightningai/sdk 2026.4.24 → 2026.4.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -5
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @lightningai/sdk
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
TypeScript SDK for [Lightning AI](https://lightning.ai) sandboxes: create and manage sandboxes, run commands, and work with files inside a sandbox.
|
|
4
4
|
|
|
5
5
|
## Requirements
|
|
6
6
|
|
|
@@ -20,12 +20,29 @@ Set an API key (or pass `apiKey` to `Sandbox.configure()`):
|
|
|
20
20
|
export LIGHTNING_API_KEY=your_key
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
```
|
|
23
|
+
```ts
|
|
24
24
|
import { Sandbox } from "@lightningai/sdk";
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
async function main() {
|
|
27
|
+
// Uses LIGHTNING_API_KEY from the environment by default
|
|
28
|
+
// (optional: Sandbox.configure({ apiKey, organizationId, baseUrl }))
|
|
29
|
+
|
|
30
|
+
const sandbox = await Sandbox.create({
|
|
31
|
+
name: "quickstart",
|
|
32
|
+
instanceType: "cpu-1",
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
const result = await sandbox.runCommand({
|
|
36
|
+
cmd: "sh",
|
|
37
|
+
args: ["-c", 'echo "Hello, World!"'],
|
|
38
|
+
env: { NODE_ENV: "development" },
|
|
39
|
+
});
|
|
40
|
+
console.log(result.output);
|
|
41
|
+
|
|
42
|
+
await sandbox.delete();
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
main().catch(console.error);
|
|
29
46
|
```
|
|
30
47
|
|
|
31
48
|
Environment variables read by the SDK:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lightningai/sdk",
|
|
3
|
-
"version": "2026.04.
|
|
3
|
+
"version": "2026.04.25",
|
|
4
4
|
"description": "Lightning AI Sandbox SDK — create and manage sandboxes, run commands, read/write files",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
"types": "dist/index.d.ts",
|
|
12
12
|
"exports": {
|
|
13
13
|
".": {
|
|
14
|
-
"
|
|
15
|
-
"
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"default": "./dist/index.js"
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
18
|
"files": [
|