Skip to main content
The TypeScript SDK provides a modern, type-safe interface for integrating S2 into your Node.js and browser applications. It supports async/await patterns and includes full TypeScript definitions.
The TypeScript SDK is compatible with S2 v1 API (v0.22+) and ready for production use.

Installation

Install via npm:

Quick Start

Initialize the Client

Basic Operations

Working with Basins

Create a Basin

List Basins

Get Basin Configuration

Delete a Basin

Working with Streams

Create a Stream

List Streams

Delete a Stream

Writing Records

Using the Producer

Direct Append

Reading Records

Using the Reader

Single Read

Check Tail

Access Tokens

Issue a Token

List Tokens

Revoke a Token

Metrics

Error Handling

Configuration

Custom Endpoint

Request Timeouts

TypeScript Types

The SDK includes full TypeScript definitions:

Browser Support

The SDK works in modern browsers with ES2020+ support. For older browsers, use a transpiler like Babel.

Resources

npm Package

View package on npm

GitHub

Source code and documentation

REST API

Underlying REST API reference

Discord

Join our community

Next Steps