@computesdk/render 1.1.7 → 1.1.8
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 +27 -8
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -19,26 +19,45 @@ RENDER_OWNER_ID=your_render_owner_id
|
|
|
19
19
|
|
|
20
20
|
## Usage
|
|
21
21
|
|
|
22
|
+
### Gateway Mode (Recommended)
|
|
23
|
+
|
|
24
|
+
Use the gateway for zero-config auto-detection:
|
|
25
|
+
|
|
26
|
+
```typescript
|
|
27
|
+
import { compute } from 'computesdk';
|
|
28
|
+
|
|
29
|
+
// Auto-detects Render from RENDER_API_KEY environment variable
|
|
30
|
+
const sandbox = await compute.sandbox.create();
|
|
31
|
+
console.log(`Created sandbox: ${sandbox.id}`);
|
|
32
|
+
|
|
33
|
+
// List all sandboxes
|
|
34
|
+
const sandboxes = await compute.sandbox.list();
|
|
35
|
+
|
|
36
|
+
// Destroy the sandbox
|
|
37
|
+
await sandbox.destroy();
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Direct Mode
|
|
41
|
+
|
|
42
|
+
For direct SDK usage without the gateway:
|
|
43
|
+
|
|
22
44
|
```typescript
|
|
23
45
|
import { render } from '@computesdk/render';
|
|
24
46
|
|
|
25
|
-
const
|
|
47
|
+
const compute = render({
|
|
26
48
|
apiKey: 'your_api_key',
|
|
27
49
|
ownerId: 'your_owner_id'
|
|
28
50
|
});
|
|
29
51
|
|
|
30
52
|
// Create a sandbox
|
|
31
|
-
const sandbox = await
|
|
32
|
-
console.log(`Created sandbox: ${sandbox.
|
|
33
|
-
|
|
34
|
-
// Get sandbox by ID
|
|
35
|
-
const retrieved = await provider.sandbox.getById(sandbox.sandboxId);
|
|
53
|
+
const sandbox = await compute.sandbox.create({ runtime: 'node' });
|
|
54
|
+
console.log(`Created sandbox: ${sandbox.id}`);
|
|
36
55
|
|
|
37
56
|
// List all sandboxes
|
|
38
|
-
const sandboxes = await
|
|
57
|
+
const sandboxes = await compute.sandbox.list();
|
|
39
58
|
|
|
40
59
|
// Destroy the sandbox
|
|
41
|
-
await
|
|
60
|
+
await sandbox.destroy();
|
|
42
61
|
```
|
|
43
62
|
|
|
44
63
|
## Currently Implemented
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@computesdk/render",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.8",
|
|
4
4
|
"description": "Render provider for ComputeSDK - managed cloud containers with automatic scaling",
|
|
5
5
|
"author": "ComputeSDK Team",
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"dist"
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@computesdk/provider": "1.0.
|
|
22
|
-
"computesdk": "1.10.
|
|
21
|
+
"@computesdk/provider": "1.0.2",
|
|
22
|
+
"computesdk": "1.10.2"
|
|
23
23
|
},
|
|
24
24
|
"keywords": [
|
|
25
25
|
"computesdk",
|