## Scoop Node.js SDK

> Node.js SDK for Roadmap Scoop for managing subscribers.

- [Getting Started](#getting-started)
- [Installation](#installation)
- [Setup](#setup)
- [Usage](#usage)
- [Contributions](#contributions)
- [License](#license)

## Getting Started

This SDK is written in TypeScript and is fully typed. It works with both TypeScript and JavaScript.

## Install

Install `@roadmapsh/scoop` using your favorite package manager.

```sh
pnpm add @roadmapsh/scoop
# or
bun add @roadmapsh/scoop
# or
npm install @roadmapsh/scoop
# or
yarn add @roadmapsh/scoop
```

## Setup

First generate an API key your hosted dashboard. Then, initialize the SDK with your API key.

```ts
import { Scoop } from '@roadmapsh/scoop';
export const scoop = new Scoop('your-api-key');
```

## Usage

Subscribing to a list:

```ts
await scoop.subscribers.subscribe({
  email: 'john@doe.com',
  listId: 'list-id',
});
```

Unsubscribing from a list:

```ts
await scoop.subscribers.unsubscribe({
  email: 'john@doe.com',
  listId: 'list-id',
});
```

Assigning tags to a subscriber:

```ts
await scoop.subscribers.assignTags({
  email: 'john@doe.com',
  listId: 'list-id',
  addTags: ['tag-1', 'tag-2'],
});
```

## Contributions

Feel free to submit pull requests, create issues, or spread the word.

## License

MIT &copy; [Arik Chakma](https://twitter.com/imarikchakma)
