# Node.js SDK (platform)

> Install and use the Ours Privacy Node.js platform SDK to manage sources, destinations, consent settings, and more from your server-side code.

Source: https://docs.oursprivacy.com/docs/platform-nodejs

Use this page to install the Ours Privacy Node.js platform SDK (`@oursprivacy/platform-sdk`) and make your first call. The SDK is fully typed and runs on Node.js 20 or later.

***

## Installation

```bash
npm install @oursprivacy/platform-sdk
```

## Usage

Create a [Platform API key](https://docs.oursprivacy.com/docs/platform-api/authentication) and set it as `OURS_PRIVACY_API_KEY`. The client reads that variable by default.

```typescript
import OursPrivacyPlatform from '@oursprivacy/platform-sdk';

const client = new OursPrivacyPlatform({
  apiKey: process.env['OURS_PRIVACY_API_KEY'], // This is the default and can be omitted
});

const page = await client.sources.list();

for (const source of page.entities) {
  console.log(source.id, source.name);
}
```

## Pagination

List methods return one page at a time, with the results in `entities`. To walk every page, iterate the list call directly:

```typescript
for await (const source of client.sources.list()) {
  console.log(source.id, source.name);
}
```

***

## Next Steps

* **[Platform API Quickstart](https://docs.oursprivacy.com/docs/platform-api/quickstart)**: the same operations against the raw REST API.
* **[Platform OpenAPI Schema](https://docs.oursprivacy.com/docs/platform-api/openapi)**: every resource and method the SDK exposes.
* **[npm package](https://www.npmjs.com/package/@oursprivacy/platform-sdk)** and **[GitHub repository](https://github.com/with-ours/platform-sdk-nodejs)**: releases, changelog, and the full README.
