Installation

npm install @stream-io/feeds-client
# or using yarn
yarn add @stream-io/feeds-client

GitHub repository: https://github.com/GetStream/stream-feeds-js. Feel free to submit bug reports and feature requests.

The package can be used with both JavaScript and TypeScript.

import { FeedsClient } from "@stream-io/feeds-client";

const client = new FeedsClient("<API key>");
await client.connectUser({ id: "john" }, "<user token>");

The constructor accepts an optional options object. timeout sets the per-request timeout in milliseconds (default 3000), and base_url overrides the API endpoint:

import { FeedsClient } from "@stream-io/feeds-client";

const client = new FeedsClient("<API key>", { timeout: 5000 });
await client.connectUser({ id: "john" }, "<user token>");