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

@thejob/marketing-client

v1.2.0

Published

Typed TypeScript/JavaScript client for the thejob-marketing-service HTTP API.

Readme

@thejob/marketing-client

Typed client for thejob-marketing-service: mailing lists, campaigns, and the configuration behind them.

import { MarketingClient } from '@thejob/marketing-client';

const marketing = new MarketingClient({
  baseUrl: process.env.MARKETING_SERVICE_URL!,
  token: adminJwt,
});

const { items, total } = await marketing.listCampaigns({ page: 1, limit: 25 });

Auth is an admin JWT, and this is a server-side client

Every endpoint here is requireAdmin. There is no API-key alternative, because marketing has no service-to-service surface — nothing else on the platform sends mail on its own account.

So construct this on the server, never in a browser. In svelte-ui that means inside a proxy endpoint, with locals.jwt as token. Handing this client a token in the browser puts an admin JWT in front of the user.

What it does not cover

Three route groups are deliberately absent, each for its own reason:

| Route | Why not | |---|---| | /dashboard/* | Marketing's own ops page, gated by a session cookie, not a bearer token. This client cannot authenticate to it, and it is a rendered admin surface rather than an API. | | POST /internal/email-status | A signed callback from email-service, which computes the signature. A generic method would only invite an unsigned call that 401s. | | GET /unsubscribe | Public, takes a token from a mail link, answers HTML to a human. |

Everything else is covered, and a test enforces it: it drives a fake fetch through every public method, compares what was requested against the routes the service actually registers, and fails in both directions — a route with no method, and a method calling a path the service does not register.

Pages are items, not results

marketing-service answers { items, total, page, limit }. jobs-service and user-service answer results. That difference is preserved here rather than harmonised: renaming it would make this client disagree with the service it describes, and the next person debugging a response would have no way to reconcile the two.

Types come from @thejob/schema

Campaign, MailingList, MailingListFilter and TemplateVariableBinding are derived with InferType from the schemas that validate them, never re-declared. A hand-written copy of a schema is exactly the thing that silently stops matching it — svelte-ui carried a RecipientPreview whose own comment asked the reader to "keep the three in sync".

Sending is asynchronous

sendCampaign answers 202. email-service sends in the background and reports progress to a signed webhook, so a returned batchId means accepted, not delivered.

A send can also be refused: if the four send switches do not all agree, the service answers 200 with blockedBy set rather than failing. That is the safety working, not an error, so check the field rather than relying on a throw.