@lightningai/sdk 2026.4.24 → 2026.4.26
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 +21 -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
|
|
|
@@ -12,6 +12,9 @@ JavaScript SDK for [Lightning AI](https://lightning.ai) sandboxes: create and ma
|
|
|
12
12
|
npm install @lightningai/sdk
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
+
> **Note**
|
|
16
|
+
> This package is published as an ES Module (ESM) only. For applications using CommonJS, use `await import("@lightningai/sdk")` to import and use this package.
|
|
17
|
+
|
|
15
18
|
## Quick start
|
|
16
19
|
|
|
17
20
|
Set an API key (or pass `apiKey` to `Sandbox.configure()`):
|
|
@@ -20,12 +23,25 @@ Set an API key (or pass `apiKey` to `Sandbox.configure()`):
|
|
|
20
23
|
export LIGHTNING_API_KEY=your_key
|
|
21
24
|
```
|
|
22
25
|
|
|
23
|
-
```
|
|
26
|
+
```ts
|
|
24
27
|
import { Sandbox } from "@lightningai/sdk";
|
|
25
28
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
async function main() {
|
|
30
|
+
// Uses LIGHTNING_API_KEY from the environment by default
|
|
31
|
+
// (optional: Sandbox.configure({ apiKey, organizationId, baseUrl }))
|
|
32
|
+
|
|
33
|
+
const sandbox = await Sandbox.create({
|
|
34
|
+
name: "quickstart",
|
|
35
|
+
instanceType: "cpu-1",
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
const result = await sandbox.runCommand("echo", ["Hello, World!"]);
|
|
39
|
+
console.log(result.output);
|
|
40
|
+
|
|
41
|
+
await sandbox.delete();
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
main().catch(console.error);
|
|
29
45
|
```
|
|
30
46
|
|
|
31
47
|
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.26",
|
|
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": [
|