open-index/open-npm huggingface dataset:
npm package: @rstreamlabs/installer
Description: Installer for rstream hosted packages.
Author: @uartnet
Latest version: 1.0.4

# @rstreamlabs/installer

This package installs hosted application binaries during `npm install`.

It reads the target application metadata from the consumer package `package.json`, resolves the correct release for the current OS and architecture, downloads the archive from the configured registry, and extracts it into the local `release/` directory.

Release and dependency update steps are documented in the workspace [README](../README.md).
npm package: @rstreamlabs/rstream
Description: JS/TS SDK for the rstream control plane and shared types.
Author: @uartnet
Latest version: 2.1.0

# `@rstreamlabs/rstream`

Control-plane and shared JS/TS SDK for managed rstream APIs.

Use this package for account-level and project-level APIs exposed by rstream,
such as `whoami`, managed tunnels project discovery, and managed TURN
credential issuance.

This package supports:

- bearer tokens
- application `clientId` / `clientSecret` pairs

When application credentials are used, the SDK signs a short-lived app token
locally before calling the control-plane API. For managed TURN credential
issuance, the control-plane endpoint still expects that short-lived auth token.

## Usage

```ts
import { RstreamClient } from "@rstreamlabs/rstream";

const client = new RstreamClient({
  credentials: { token: process.env.RSTREAM_AUTHENTICATION_TOKEN! },
});

const whoami = await client.whoami();
const projects = await client.tunnels.projects.list();
const project =
  await client.tunnels.projects.resolveByEndpoint("project-endpoint");
const turn = await client.tunnels.projects.createTurnCredentials(project.id);
```

Application credentials work as well:

```ts
import { RstreamClient } from "@rstreamlabs/rstream";

const client = new RstreamClient({
  credentials: {
    clientId: process.env.RSTREAM_CLIENT_ID!,
    clientSecret: process.env.RSTREAM_CLIENT_SECRET!,
  },
});

const whoami = await client.whoami();
const projects = await client.tunnels.projects.list();
```

`@rstreamlabs/rstream` reads `RSTREAM_API_URL` and
`RSTREAM_AUTHENTICATION_TOKEN` when they are not provided explicitly.

For engine and data-plane APIs, use [`@rstreamlabs/tunnels`](../tunnels/README.md).
npm package: @rstreamlabs/rstream-cli
Description: Command-line interface for rstream.
Author: @uartnet
Latest version: 1.10.0

# @rstreamlabs/rstream-cli

This package provides the `rstream` npm wrapper.

During `npm install`, it uses `@rstreamlabs/installer` to download the hosted `rstream` binary for the current OS and architecture, then runs that binary from the local `release/` directory.
npm package: @rstreamlabs/tunnels
Description: JS/TS SDK for the rstream tunnels data plane and engine APIs.
Author: @uartnet
Latest version: 1.0.1

# `@rstreamlabs/tunnels`

Data-plane JS/TS SDK for rstream tunnels.

Use this package to talk directly to the tunnels engine: list tunnels, inspect
clients, watch engine events, validate webhooks, and create fine-grained app
tokens.

The package supports both:

- direct engine usage, including self-hosted deployments
- managed rstream projects resolved via the control plane
- bearer-token authentication and application credentials

## Self-hosted usage

```ts
import { RstreamTunnelsClient } from "@rstreamlabs/tunnels";

const client = new RstreamTunnelsClient({
  credentials: { token: process.env.RSTREAM_AUTHENTICATION_TOKEN! },
  engine: process.env.RSTREAM_ENGINE!,
});

const tunnels = await client.tunnels.list();
```

## Managed usage

```ts
import { RstreamTunnelsClient } from "@rstreamlabs/tunnels";

const client = new RstreamTunnelsClient({
  credentials: { token: process.env.RSTREAM_AUTHENTICATION_TOKEN! },
  projectEndpoint: "project-endpoint",
});

const engine = await client.getEngine();
const turn = await client.turn.createCredentials();
```

## Application Credentials

`@rstreamlabs/tunnels` can work directly with an app `clientId` and
`clientSecret`. This is the intended backend flow when you want the server to
mint short-lived tokens for downstream clients.

```ts
import { RstreamTunnelsClient } from "@rstreamlabs/tunnels";

const client = new RstreamTunnelsClient({
  credentials: {
    clientId: process.env.RSTREAM_CLIENT_ID!,
    clientSecret: process.env.RSTREAM_CLIENT_SECRET!,
  },
  projectEndpoint: "project-endpoint",
});

const { token } = await client.auth.createAuthToken({ expires_in: 60 });
```

## Fine-Grained Tokens

```ts
import { RstreamTunnelsClient } from "@rstreamlabs/tunnels";

const admin = new RstreamTunnelsClient({
  credentials: {
    clientId: process.env.RSTREAM_CLIENT_ID!,
    clientSecret: process.env.RSTREAM_CLIENT_SECRET!,
  },
  projectEndpoint: "project-endpoint",
});

const { token } = await admin.auth.createAuthToken({
  expires_in: 60,
  scopes: {
    tunnels: {
      create: { filters: { protocol: { oneof: ["http"] } } },
      connect: { params: { path: { regex: "^/api" } } },
      list: { select: { id: true, name: true, protocol: true } },
    },
  },
});
```

## TURN credentials

`@rstreamlabs/tunnels` supports the same three TURN credential paths as the
platform:

- managed API issuance with a short-lived auth token
- local derivation from a PAT
- local derivation from an app `clientId` and `clientSecret`

```ts
import { createTURNCredentials } from "@rstreamlabs/tunnels";

const turn = await createTURNCredentials({
  credentials: { token: process.env.RSTREAM_AUTHENTICATION_TOKEN! },
  projectEndpoint: "project-endpoint",
});
```

`@rstreamlabs/tunnels` reads `RSTREAM_API_URL`, `RSTREAM_ENGINE`, and
`RSTREAM_AUTHENTICATION_TOKEN` when they are not provided explicitly.

For managed control-plane APIs, use [`@rstreamlabs/rstream`](../rstream/README.md).