curl -fsSL https://getstream.io/cli.sh | bash
getstream skillsInstallation
This SDK is the server half of your integration. Your users read and write feeds from your app with a client SDK, and anything that needs a connected user or a live WebSocket belongs there: the state layer, device push registration, and client-side error handling. See the client-side overview for what lives there. Token signing stays on this side, because it needs your API secret.
Stream CLI and Agent Skills
Manage Stream from your terminal with the Stream CLI, including scripting and AI-agent workflows. Install the CLI and the default Agent Skills:
Then ask your agent in plain English, for example:
/stream List feed groups in my app.See the CLI docs and Agent Skills docs for more.
npm install @stream-io/node-sdk
// or using yarn
yarn add @stream-io/node-sdkGitHub repository: https://github.com/GetStream/stream-node. Feel free to submit bug reports and feature requests.
The package is tested against these environments:
- Node.js@22
- Node.js@24
- Bun@1
Node@16 is not supported.
The package can be used with both JavaScript and TypeScript.
To create a server-side client, you'll need your API key and secret. Both of them can be found in your Stream Dashboard.
You can optionally pass a timeout for the API requests, the default timeout is 3000ms. The shared defaults and tuning options are documented on Connection pooling; the timeout option and the custom agent below are the Node specifics.
import { StreamClient } from "@stream-io/node-sdk";
// or
// const { StreamClient } = require("@stream-io/node-sdk");
const apiKey = "";
const secret = "";
client = new StreamClient(apiKey, secret);
// optionally add timeout to API requests
// the default timeout is 3000ms
client = new StreamClient(apiKey, secret, { timeout: 3000 });Custom HTTP agent
The SDK uses the built-in fetch. To control connection pooling and keep-alive, pass a custom undici Agent as the agent option; it is used as the dispatcher for all requests:
import { StreamClient } from "@stream-io/node-sdk";
import { Agent } from "undici";
const agent = new Agent({
connections: 10, // max connections per origin
keepAliveTimeout: 55_000, // idle socket timeout in ms
});
const client = new StreamClient(apiKey, secret, { timeout: 3000, agent });