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

@davidcb/campaignmonitor-node

v0.1.0

Published

Campaign Monitor API wrapper for Node.js environments

Readme

@davidcb/campaignmonitor-node

TypeScript-first Campaign Monitor API wrapper for Node.js environments (Nuxt, Nitro, server runtimes).

It exposes convenient resource clients with methods matching Campaign Monitor REST routes.

Installation

npm install @davidcb/campaignmonitor-node

Quick start

API key auth

import { createCampaignMonitorClient } from "@davidcb/campaignmonitor-node"

const cm = createCampaignMonitorClient({
  auth: { apiKey: process.env.CM_API_KEY! },
})

const clients = await cm.general.getClients()
console.log(clients.data)

OAuth auth

import { createCampaignMonitorClient } from "@davidcb/campaignmonitor-node"

const cm = createCampaignMonitorClient({
  auth: { accessToken: "...", refreshToken: "..." },
})

await cm.campaigns.summary("campaign-id")

Resources and methods

general

  • getTimezones()
  • getSystemDate()
  • getCountries()
  • getClients()
  • getAdministrators()

clients

  • create(payload)
  • get(clientId)
  • updateBasics(clientId, payload)
  • delete(clientId)
  • getLists(clientId)
  • getSegments(clientId)
  • getCampaigns(clientId, sentFromDate?)
  • getJourneys(clientId)

campaigns

  • create(clientId, payload)
  • createFromTemplate(clientId, payload)
  • sendPreview(campaignId, payload)
  • send(campaignId, payload)
  • unschedule(campaignId)
  • delete(campaignId)
  • summary(campaignId)
  • opens(campaignId, date?, page?, pageSize?)
  • clicks(campaignId, date?, page?, pageSize?)
  • bounces(campaignId, date?, page?, pageSize?)

lists

  • create(clientId, payload)
  • get(listId)
  • update(listId, payload)
  • delete(listId)
  • customFields(listId)
  • createCustomField(listId, payload)
  • stats(listId)
  • segments(listId)
  • webhooks(listId)

subscribers

  • add(listId, payload)
  • import(listId, payload)
  • get(listId, email)
  • update(listId, email, payload)
  • history(listId, email)
  • unsubscribe(listId, email)
  • delete(listId, email)

segments

  • create(listId, payload)
  • get(segmentId)
  • update(segmentId, payload)
  • delete(segmentId)
  • subscribers(segmentId, date?, page?, pageSize?)

templates

  • create(clientId, payload)
  • get(templateId)
  • update(templateId, payload)
  • delete(templateId)

people

  • add(clientId, payload)
  • get(clientId, email)
  • update(clientId, email, payload)
  • delete(clientId, email)

administrators

  • add(payload)
  • get(email)
  • update(email, payload)
  • delete(email)

journeys

  • details(journeyId)

journeyEmails

  • recipients(emailId, date?, page?, pageSize?)
  • opens(emailId, date?, page?, pageSize?)
  • clicks(emailId, date?, page?, pageSize?)
  • unsubscribes(emailId, date?, page?, pageSize?)
  • bounces(emailId, date?, page?, pageSize?)

events

  • track(clientId, eventType, payload) where eventType is custom | identify | shopify

transactionalClassic

  • send(payload)
  • groups(payload?)

transactionalSmart

  • list(payload?)
  • send(smartEmailId, payload)
  • details(smartEmailId)

transactionalTimeline

  • messages(payload?)
  • details(messageId)
  • resend(messageId, payload?)
  • statistics(payload?)

Nuxt usage

Create a server utility in server/utils/campaignMonitor.ts:

import { createCampaignMonitorClient } from "@davidcb/campaignmonitor-node"

export const campaignMonitor = createCampaignMonitorClient({
  auth: { apiKey: process.env.CM_API_KEY! },
})

Then call it from server routes/services only.

Development

npm install
npm run typecheck
npm run test
npm run build

Notes

  • This wrapper intentionally mirrors Campaign Monitor API resources and paths.
  • Payload schemas are left open (unknown) so all API options are accepted.
  • You can progressively add strict per-endpoint types as needed in your app.