Skip to main content
Streams live within basins and are the core data structure in S2. You can have an unlimited amount 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.