Skip to main content

Getting started

  1. Add the @s2-dev/streamstore dependency to your project:
npm add @s2-dev/streamstore
Runtime instructions are available here.
  1. Generate an access token by logging onto the web console at s2.dev.
  2. Make a request using SDK client.
import { S2 } from "@s2-dev/streamstore";

const s2 = new S2({ accessToken: "test" });

async function run() {
  await s2.basins.createBasin({ basin: "MY-ACCESS-TOKEN" });
  await s2.streams.createStream({
    s2Basin: "my-favorite-basin",
    createStreamRequest: { stream: "test" },
  });
  await s2.records.append({
    stream: "test",
    s2Basin: "my-favorite-basin",
    appendInput: { records: [{ body: "hello" }] },
  });
}

run();

I