open-index/open-npm huggingface dataset:
npm package: @superserve/sdk
Description: TypeScript SDK for the Superserve sandbox API
Latest version: 0.2.3

# Superserve SDK

TypeScript SDK for the [Superserve](https://superserve.ai) sandbox API — spin up isolated sandboxes, run commands in them, and tear them down from code.

## Install

```bash
npm install @superserve/sdk
# or
bun add @superserve/sdk
# or
yarn add @superserve/sdk
```

## Quick start

```ts
import { SuperserveClient } from "@superserve/sdk"

const client = new SuperserveClient({
  apiKey: process.env.SUPERSERVE_API_KEY!,
})

const sandbox = await client.sandboxes.createSandbox({
  name: "hello-world",
})

try {
  const result = await client.exec.command({
    sandbox_id: sandbox.id!,
    body: { command: "echo 'Hello from Superserve!'" },
  })
  console.log(result.stdout)
} finally {
  await client.sandboxes.deleteSandbox({ sandbox_id: sandbox.id! })
}
```

Get an API key from the [Superserve console](https://console.superserve.ai).

## Resource clients

The `SuperserveClient` exposes four resource groups:

- **`client.sandboxes`** — create, list, get, patch, pause, resume, and delete sandboxes
- **`client.exec`** — run commands inside a sandbox (`command`) or stream output (`commandStream`)
- **`client.files`** — upload and download files to and from a sandbox
- **`client.system`** — health check

## Configuration

```ts
import { SuperserveClient, SuperserveEnvironment } from "@superserve/sdk"

const client = new SuperserveClient({
  apiKey: "ss_live_...",               // required
  environment: SuperserveEnvironment.Production,  // optional
  baseUrl: "http://localhost:8080",    // optional, overrides environment
  timeoutInSeconds: 60,                // optional, default 60
  maxRetries: 2,                       // optional, default 2
})
```

Request-level overrides are supported via an optional second argument on every method:

```ts
await client.exec.command(
  { sandbox_id: "sbx_...", body: { command: "long-running-task" } },
  { timeoutInSeconds: 300, maxRetries: 0 },
)
```

## Error handling

All errors extend `SuperserveError`. Specific API error classes are exposed under the `Superserve` namespace:

```ts
import { SuperserveClient, Superserve } from "@superserve/sdk"

try {
  await client.sandboxes.getSandbox({ sandbox_id: "sbx_missing" })
} catch (err) {
  if (err instanceof Superserve.NotFoundError) {
    console.log("sandbox does not exist")
  } else if (err instanceof Superserve.BadRequestError) {
    console.error("invalid request:", err.body)
  } else {
    throw err
  }
}
```

Available error classes: `BadRequestError`, `UnauthorizedError`, `NotFoundError`, `ConflictError`, `InternalServerError`.

## Documentation

Full docs: [docs.superserve.ai](https://docs.superserve.ai)

## License

Apache-2.0
npm package: @superset-cat/super-table
Description: Super Table
Author: My Name
Latest version: 0.0.2

# super-table

This is the Super Table Superset Chart Plugin.

### Usage

To build the plugin, run the following commands:

```
npm ci
npm run build
```

Alternatively, to run the plugin in development mode (=rebuilding whenever changes are made), start the dev server with the following command:

```
npm run dev
```

To add the package to Superset, go to the `superset-frontend` subdirectory in your Superset source folder (assuming both the `super-table` plugin and `superset` repos are in the same root directory) and run
```
npm i -S ../../super-table
```

If your Superset plugin exists in the `superset-frontend` directory and you wish to resolve TypeScript errors about `@superset-ui/core` not being resolved correctly, add the following to your `tsconfig.json` file:

```
"references": [
  {
    "path": "../../packages/superset-ui-chart-controls"
  },
  {
    "path": "../../packages/superset-ui-core"
  }
]
```

You may also wish to add the following to the `include` array in `tsconfig.json` to make Superset types available to your plugin:

```
"../../types/**/*"
```

Finally, if you wish to ensure your plugin `tsconfig.json` is aligned with the root Superset project, you may add the following to your `tsconfig.json` file:

```
"extends": "../../tsconfig.json",
```

After this edit the `superset-frontend/src/visualizations/presets/MainPreset.js` and make the following changes:

```js
import { SuperTable } from 'super-table';
```

to import the plugin and later add the following to the array that's passed to the `plugins` property:
```js
new SuperTable().configure({ key: 'super-table' }),
```

After that the plugin should show up when you run Superset, e.g. the development server:

```
npm run dev-server
```
npm package: @superset-cat/superset-ant-waves
Description: Superset Ant Waves
Author: My Name
Latest version: 0.1.0

# superset-ant-waves

This is the Superset Ant Waves Superset Chart Plugin.

### Usage

To build the plugin, run the following commands:

```
npm ci
npm run build
```

Alternatively, to run the plugin in development mode (=rebuilding whenever changes are made), start the dev server with the following command:

```
npm run dev
```

To add the package to Superset, go to the `superset-frontend` subdirectory in your Superset source folder (assuming both the `superset-ant-waves` plugin and `superset` repos are in the same root directory) and run
```
npm i -S ../../superset-ant-waves
```

If your Superset plugin exists in the `superset-frontend` directory and you wish to resolve TypeScript errors about `@superset-ui/core` not being resolved correctly, add the following to your `tsconfig.json` file:

```
"references": [
  {
    "path": "../../packages/superset-ui-chart-controls"
  },
  {
    "path": "../../packages/superset-ui-core"
  }
]
```

You may also wish to add the following to the `include` array in `tsconfig.json` to make Superset types available to your plugin:

```
"../../types/**/*"
```

Finally, if you wish to ensure your plugin `tsconfig.json` is aligned with the root Superset project, you may add the following to your `tsconfig.json` file:

```
"extends": "../../tsconfig.json",
```

After this edit the `superset-frontend/src/visualizations/presets/MainPreset.js` and make the following changes:

```js
import { SupersetAntWaves } from 'superset-ant-waves';
```

to import the plugin and later add the following to the array that's passed to the `plugins` property:
```js
new SupersetAntWaves().configure({ key: 'superset-ant-waves' }),
```

After that the plugin should show up when you run Superset, e.g. the development server:

```
npm run dev-server
```
npm package: @superset-cat/superset-my-first-chart
Description: Superset My First Chart
Author: My Name
Latest version: 0.1.0

# superset-my-first-chart

This is the Superset My First Chart Superset Chart Plugin.

### Usage

To build the plugin, run the following commands:

```
npm ci
npm run build
```

Alternatively, to run the plugin in development mode (=rebuilding whenever changes are made), start the dev server with the following command:

```
npm run dev
```

To add the package to Superset, go to the `superset-frontend` subdirectory in your Superset source folder (assuming both the `superset-my-first-chart` plugin and `superset` repos are in the same root directory) and run
```
npm i -S ../../superset-my-first-chart
```

If your Superset plugin exists in the `superset-frontend` directory and you wish to resolve TypeScript errors about `@superset-ui/core` not being resolved correctly, add the following to your `tsconfig.json` file:

```
"references": [
  {
    "path": "../../packages/superset-ui-chart-controls"
  },
  {
    "path": "../../packages/superset-ui-core"
  }
]
```

You may also wish to add the following to the `include` array in `tsconfig.json` to make Superset types available to your plugin:

```
"../../types/**/*"
```

Finally, if you wish to ensure your plugin `tsconfig.json` is aligned with the root Superset project, you may add the following to your `tsconfig.json` file:

```
"extends": "../../tsconfig.json",
```

After this edit the `superset-frontend/src/visualizations/presets/MainPreset.js` and make the following changes:

```js
import { SupersetMyFirstChart } from 'superset-my-first-chart';
```

to import the plugin and later add the following to the array that's passed to the `plugins` property:
```js
new SupersetMyFirstChart().configure({ key: 'superset-my-first-chart' }),
```

After that the plugin should show up when you run Superset, e.g. the development server:

```
npm run dev-server
```
npm package: @superset-cat/superset-plugin-chart-hello-world-cat
Description: Superset Plugin Chart Hello World
Author: My Name
Latest version: 0.0.1

# superset-plugin-chart-hello-world

This is the Superset Plugin Chart Hello World Superset Chart Plugin.

### Usage

To build the plugin, run the following commands:

```
npm ci
npm run build
```

Alternatively, to run the plugin in development mode (=rebuilding whenever changes are made), start the dev server with the following command:

```
npm run dev
```

To add the package to Superset, go to the `superset-frontend` subdirectory in your Superset source folder (assuming both the `superset-plugin-chart-hello-world` plugin and `superset` repos are in the same root directory) and run
```
npm i -S ../../superset-plugin-chart-hello-world
```

After this edit the `superset-frontend/src/visualizations/presets/MainPreset.js` and make the following changes:

```js
import { SupersetPluginChartHelloWorld } from 'superset-plugin-chart-hello-world';
```

to import the plugin and later add the following to the array that's passed to the `plugins` property:
```js
new SupersetPluginChartHelloWorld().configure({ key: 'superset-plugin-chart-hello-world' }),
```

After that the plugin should show up when you run Superset, e.g. the development server:

```
npm run dev-server
```