A Node client library for Listmonk
Find a file
Alan Bridgeman 48db1bb21b
Some checks failed
Publish to private NPM registry / publish (push) Failing after 26s
More automation work
2025-06-11 13:20:01 -05:00
.forgejo/workflows More automation work 2025-06-11 13:20:01 -05:00
src Forgot a few minor things about packaging for use inside other projects 😀. Should be good now though. 2024-10-14 17:51:59 -05:00
.env.example Initial code commit 2024-10-14 14:41:44 -05:00
.gitignore Mainly stuff related to trying to setup automation 2025-06-11 12:51:14 -05:00
.npmrc.example Mainly stuff related to trying to setup automation 2025-06-11 12:51:14 -05:00
LICENSE Initial commit 2024-10-13 10:56:52 -05:00
package.json More automation work 2025-06-11 13:20:01 -05:00
README.md Initial code commit 2024-10-14 14:41:44 -05:00
tsconfig.json Forgot a few minor things about packaging for use inside other projects 😀. Should be good now though. 2024-10-14 17:51:59 -05:00
yarn.lock Initial code commit 2024-10-14 14:41:44 -05:00

Listmonk Node Client Library

The idea of this package is to create a more natural feeling client library (particularly for anybody with OOP experiences) than the existing Listmonk Node API library.

In particular this means abstracting away a lot of the API structure and calls. And trying to make it feel like the way you would give instructions to someone if you were telling them how to work with the software through the web UI.

That said, still pretty heavy in development and not particularly feature complete. If you need completeness, performance, etc... I'd recommend looking at that other library linked above.

Getting Started

Granted, this is largely meant as a software package that you would list in your dependencies. But, for demo purposes you'll need to copy and fill out the .env.example file into a .env file. And then run: yarn demo (or equivalent). This will create a campaign, template, list and subscriber in the instance you point it to. Under th hood this just runs the "compiled" version of demo.ts

demo.ts is also where I would start if your looking to understand how to use this package. Though it should be fairly straightforward and intuitive for anyone with an OOP and typescript background.

Some Notes

  • Forgetting to remember to call save() on objects to sync with Listmonk I suspect will be a popular issue for people
  • The fromData method is an instance method, NOT a static one, so follows a similar theory to "Hydration". That is, the instance is usually created and then is filled in with data (these are meant to chain - ex. new <APIObject>().fromData(...))
  • You could, call constructors but using the static .create methods are usually easier/better.
  • I publish to my own private package repository not NPM (hence the @BridgemanAccessible/ at the beginning of the package name)

Small Promotions

Contributing, Issues and Pull Request

Feel free to submit issues or pull requests when applicable. I make no promises about answering or any kind of updating/maintenance (particularly on any kind of schedule). But I will try to work with others to have this work for them as I can.