# Installation

>
> **Note:** This SDK is the client half of your integration. Feed groups, ranking, permissions, push setup and bulk imports are configured from your backend with a server-side SDK or the REST API, and the token your app connects with has to be signed there too. See the [server-side overview](https://getstream.io/activity-feeds/docs/javascript/server-side/) for what belongs there, starting with [tokens and authentication](https://getstream.io/docs/platform/authentication/).
>

## Build with Stream CLI and Agent Skills

The [Stream CLI](https://getstream.io/cli/docs/) and [Agent Skills](https://getstream.io/agent-skills/docs/) give AI coding agents the tools and knowledge to work with Stream. There is no dedicated skill pack for JavaScript yet, but the default skills still help with live documentation and CLI-driven API work.

Install the CLI and the default skills:

```bash
curl -fsSL https://getstream.io/cli.sh | bash
getstream skills
```

Once installed, invoke `/stream` from your agent. It routes documentation lookups and API operations for you.

Stream Agent Skills can also be installed from [skills.sh](https://www.skills.sh/getstream/agent-skills/stream).

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

GitHub repository: [https://github.com/GetStream/stream-feeds-js](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.

## Client configuration

```js
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:

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

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

### Custom headers

`custom_headers` are sent along with every API request:

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

const client = new FeedsClient("<API key>", {
  custom_headers: {
    "x-stream-ext": "my-value",
  },
});
await client.connectUser({ id: "john" }, "<user token>");
```

`custom_headers` can't be used to overwrite the SDK's internal settings, and they apply to HTTP requests only, not to the WebSocket connection.

---

For the most recent version of this documentation, visit [https://getstream.io/activity-feeds/docs/javascript/installation/](https://getstream.io/activity-feeds/docs/javascript/installation/).