npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@create-send/node-js

v0.1.0

Published

Node.js SDK for the Campaign Monitor API.

Readme

createsend-nodejs

Node.js SDK for the Campaign Monitor API

Package managers

Examples below use npm. For pnpm or Yarn, swap commands as follows:

| Task | npm | pnpm | Yarn | | --- | --- | --- | --- | | Add to your project | npm install @create-send/node-js | pnpm add @create-send/node-js | yarn add @create-send/node-js | | Install dependencies (dev) | npm install | pnpm install | yarn | | Run a package script | npm run <name> | pnpm <name> | yarn <name> |

Install

npm install @create-send/node-js

Usage

import { Createsend } from '@create-send/node-js';

const cs = new Createsend(process.env.CREATESEND_API_KEY);

const { data, error } = await cs.clients.pagedCampaigns({
  id: 'CLIENT_ID',
  query: { page: 1, pageSize: 50 },
});
if (error) {
  console.error(error.name, error.message);
} else {
  console.log(data);
}

The constructor accepts an API key (falls back to CREATESEND_API_KEY) and options:

new Createsend(apiKey, {
  baseUrl: 'https://api.createsend.com/api/v3.4',
  userAgent: 'my-app/1.0',
  fetch: customFetch, // optional override
});

All resource methods return Promise<Response<T>> — a discriminated union of { data, error: null } or { data: null, error }. Errors are never thrown by API calls (the constructor will throw if the API key is missing).

Examples

Each method takes a single options object combining path params, an optional query object, and an optional body. The data shape on success is typed from the OpenAPI spec.

Campaign summary

GET /campaigns/{id}/summary.json

const { data, error } = await cs.campaigns.summaryWithName({ id: 'CAMPAIGN_ID' });
if (data) {
  console.log(data.Recipients, data.TotalOpened, data.Clicks, data.WebVersionURL);
}

Campaign opens

GET /campaigns/{id}/opens.jsondate (lower bound) is required; pagination optional.

const { data } = await cs.campaigns.getCampaignOpens({
  id: 'CAMPAIGN_ID',
  query: {
    date: '2026-01-01',
    page: 1,
    pageSize: 1000,
    orderField: 'date',
    orderDirection: 'desc',
  },
});
console.log(data?.Results, data?.TotalNumberOfRecords);

Campaign clicks

GET /campaigns/{id}/clicks.json

const { data } = await cs.campaigns.getCampaignClicks({
  id: 'CAMPAIGN_ID',
  query: { date: '2026-01-01', page: 1, pageSize: 1000 },
});
for (const click of data?.Results ?? []) {
  console.log(click.EmailAddress, click.URL, click.Date);
}

Subscriber history

GET /subscribers/{listid}/history.json — full open/click/unsubscribe trail for one subscriber.

const { data } = await cs.subscribers.getSubscriberHistory({
  listId: 'LIST_ID',
  query: { email: '[email protected]' },
});
console.log(data); // array of campaign/automation events

Add a subscriber to a list

POST /subscribers/{listid}.json

const { data, error } = await cs.subscribersConsentToTrack.addSubscribersConsentToTrack({
  listId: 'LIST_ID',
  body: {
    EmailAddress: '[email protected]',
    Name: 'Jane Example',
    CustomFields: [
      { Key: 'website', Value: 'https://example.com' },
    ],
    Resubscribe: true,
    RestartSubscriptionBasedAutoresponders: false,
    ConsentToTrack: 'Yes',
  },
});
if (error) console.error(error.statusCode, error.message);
else console.log('subscribed:', data);

List stats

GET /lists/{listid}/stats.json

const { data } = await cs.lists.getListStats({ listId: 'LIST_ID' });
console.log(
  data?.TotalActiveSubscribers,
  data?.TotalUnsubscribes,
  data?.TotalBounces,
);

Regenerating from the OpenAPI spec

The resource classes and per-operation interfaces under src/ are generated from spec/createsend-openapi.yaml.

npm run generate

To update for a new spec version, replace spec/createsend-openapi.yaml and re-run the script. Files marked // DO NOT EDIT — generated by scripts/generate.ts will be overwritten; hand edits belong in src/createsend.ts, src/interfaces.ts, src/common/, and src/index.ts (between the GENERATED:* markers the generator manages its own block; the rest is yours).

Build

npm install
npm run generate
npm run typecheck
npm run build