Documentation Index
Fetch the complete documentation index at: https://s2.dev/docs/llms.txt
Use this file to discover all available pages before exploring further.
S2 provides SDKs across several languages to simplify working with our core APIs.
While the REST API can be used directly from any HTTP client, the SDKs provide higher-level abstractions (like the Producer API), retry and error handling logic, rich types, and more performant streaming sessions.
SDKs
Each repository also contains a variety of examples to demonstrate some common use cases.
Getting Started
Every SDK follows the same pattern: create a client with an access token, then navigate to basins and streams hierarchically.
TypeScript
Python
Go
Rust
import { S2 } from "@s2-dev/streamstore";
const client = new S2({
accessToken: process.env.S2_ACCESS_TOKEN!,
});
const basin = client.basin("my-basin");
const stream = basin.stream("my-stream");
import os
from s2_sdk import S2
client = S2(os.environ["S2_ACCESS_TOKEN"])
basin = client.basin("my-basin")
stream = basin.stream("my-stream")
package main
import (
"os"
"github.com/s2-streamstore/s2-sdk-go/s2"
)
func main() {
client := s2.New(os.Getenv("S2_ACCESS_TOKEN"), nil)
basin := client.Basin("my-basin")
_ = basin.Stream("my-stream")
}
use s2_sdk::{S2, types::S2Config};
let client = S2::new(S2Config::new(std::env::var("S2_ACCESS_TOKEN")?))?;
let basin = client.basin("my-basin".parse()?);
let stream = basin.stream("my-stream".parse()?);
From here, operations fall into two categories: basin and stream operations for managing resources, and appending and reading for working with records. See endpoints and retries + timeouts for configuration details.