Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,15 @@ make e2e # optional: the end-to-end tests
images from the [latest release](https://github.com/different-ai/differently/releases).

Then call it from code ([TypeScript](sdk/typescript), [Python](sdk/python),
[Go](pkg/client)):
[Go](pkg/client)). The SDKs are not on npm or PyPI yet; each README says how
to install it from this repository.

```ts
import { Differently } from "@differently/sdk";

const differently = new Differently({ apiKey: process.env.DIFFERENTLY_API_KEY });
const sandbox = await differently.sandboxes.create({
// projectId: "prj_default", // needed with an operator key, such as the dev token
profile: "small",
placement: { strategy: "private-first", external: "never" },
});
Expand Down
13 changes: 9 additions & 4 deletions sdk/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,16 @@ picks the pool; the SDK never needs to know which backend runs the sandbox.

## Install

The SDK is not on PyPI yet. Install it from this repository:

```sh
pip install differently
pip install "git+https://github.com/different-ai/differently.git#subdirectory=sdk/python"
```

Until the package is published, install from a checkout: `pip install ./sdk/python`.
or from a checkout: `pip install ./sdk/python`.

Do not run `pip install differently`: that name on PyPI belongs to an
unrelated project.

## Quickstart

Expand Down Expand Up @@ -104,12 +109,12 @@ and other POSTs are never retried.
| `Sandbox` handle | `exec`, `exec_stream`, `files.list/read/read_text/write`, `stop`, `start`, `pause`, `resume`, `snapshot`, `fork`, `expose_port`, `explain_placement`, `refresh`, `update`, `wait`, `delete` |
| `snapshots` | `list`, `get`, `delete` |
| `projects` | `list`, `create`, `get`, `delete` |
| `api_keys` | `list`, `create`, `revoke` |
| `api_keys` | `list`, `create`, `get`, `rotate`, `revoke` |
| `quotas`, `usage` | `get` |
| `audit_events` | `list`, `iterate` |
| `policies` | `list`, `put`, `delete` |
| `capabilities`, `profiles`, `templates`, `classifications` | `list` |
| `admin` | `organizations.{list,create,get,update,suspend,resume}`, `projects.set_quota`, `pools.{list,get,create,update,drain,undrain,delete}`, `agents.list`, `trust_report`, `verify_audit`, `terminate_sandbox`, `reconcile` |
| `admin` | `organizations.{list,create,get,update,suspend,resume}`, `projects.set_quota`, `pools.{list,get,create,update,drain,undrain,use,delete}`, `secrets.{list,put,delete}`, `trust_report`, `verify_audit`, `terminate_sandbox`, `reconcile` |
| client | `me`, `version` |

Keyword arguments are snake_case. Records come back as plain dicts keyed exactly
Expand Down
14 changes: 8 additions & 6 deletions sdk/typescript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ picks the pool; the SDK never needs to know which backend runs the sandbox.

## Install

The SDK is not on npm yet (`npm install @differently/sdk` finds nothing).
Build it from a checkout of this repository and install that folder:

```sh
npm install @differently/sdk
git clone https://github.com/different-ai/differently.git
(cd differently/sdk/typescript && npm ci && npm run build)
npm install ./differently/sdk/typescript
```

Until the package is published, install from a checkout:
`npm install ./sdk/typescript` (run `npm run build` there first).

## Quickstart

```ts
Expand Down Expand Up @@ -96,12 +98,12 @@ POSTs are never retried.
| `Sandbox` handle | `exec`, `execStream`, `files.list/read/readText/write`, `stop`, `start`, `pause`, `resume`, `snapshot`, `fork`, `exposePort`, `explainPlacement`, `refresh`, `update`, `wait`, `delete` |
| `snapshots` | `list`, `get`, `delete` |
| `projects` | `list`, `create`, `get`, `delete` |
| `apiKeys` | `list`, `create`, `revoke` |
| `apiKeys` | `list`, `create`, `get`, `rotate`, `revoke` |
| `quotas`, `usage` | `get` |
| `auditEvents` | `list`, `iterate` |
| `policies` | `list`, `put`, `delete` |
| `capabilities`, `profiles`, `templates`, `classifications` | `list` |
| `admin` | `organizations.{list,create,get,update,suspend,resume}`, `projects.setQuota`, `pools.{list,get,create,update,drain,undrain,delete}`, `agents.list`, `trustReport`, `verifyAudit`, `terminateSandbox`, `reconcile` |
| `admin` | `organizations.{list,create,get,update,suspend,resume}`, `projects.setQuota`, `pools.{list,get,create,update,drain,undrain,use,delete}`, `secrets.{list,put,delete}`, `trustReport`, `verifyAudit`, `terminateSandbox`, `reconcile` |
| client | `me`, `version` |

`list` returns one page (`{ items, nextCursor }`); `iterate` walks every page.
Expand Down
Loading