Skip to main content

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.

Streams live within basins and are the core data structure in S2. You can have an unlimited number of streams, and create them instantly (even on first use). Data retention policies (e.g. TTL-based trimming), storage classes, timestamping behavior, are all configurable.
// List streams
const streams = await basin.streams.list({ prefix: "user-" });

// Create a stream
await basin.streams.create({
	stream: "user-actions",
	config: {
		/* optional configuration */
	},
});

// Get configuration
const streamConfig = await basin.streams.getConfig({ stream: "user-actions" });

// Delete
await basin.streams.delete({ stream: "user-actions" });
See stream configuration for more details on all options.