@roadmapsh/scoop
Version:
NodeJS sdk for Scoop
76 lines (54 loc) • 1.36 kB
Markdown
> Node.js SDK for Roadmap Scoop for managing subscribers.
- [Getting Started](
- [Installation](
- [Setup](
- [Usage](
- [Contributions](
- [License](
This SDK is written in TypeScript and is fully typed. It works with both TypeScript and JavaScript.
Install `@roadmapsh/scoop` using your favorite package manager.
```sh
pnpm add @roadmapsh/scoop
bun add @roadmapsh/scoop
npm install @roadmapsh/scoop
yarn add @roadmapsh/scoop
```
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');
```
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'],
});
```
Feel free to submit pull requests, create issues, or spread the word.
MIT © [Arik Chakma](https://twitter.com/imarikchakma)