Registry / communication / litmus-api

litmus-api

JSON →
library0.3.2jsnpmunverified

A Node.js client library for the Litmus Customer API, allowing email testing automation. Version 0.3.2 is the latest stable release. It wraps all major API endpoints (tests, versions, etc.) and returns promises via Bluebird. Key differentiator is full promise-based async handling compared to callback-based alternatives. Suitable for integrating email testing into CI/CD pipelines.

npm install litmus-api
INSTALL
IMPORT
SIG · LITMUS-API
L
litmus-api
communicationjavascriptv0.3.2
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import Litmus from 'litmus-api'
const litmus = require('litmus-api')
CommonJS require pattern works; ESM import is possible if module resolution supports it.
Litmus
const Litmus = require('litmus-api')
const { Litmus } = require('litmus-api')
The package exports a constructor as default, not a named export.
Litmus
import Litmus from 'litmus-api'
import { Litmus } from 'litmus-api'
Named import does not work; use default import.

Shows how to instantiate the Litmus client with credentials and fetch a list of tests.

const Litmus = require('litmus-api'); const api = new Litmus({ username: process.env.LITMUS_USERNAME ?? 'your-username', password: process.env.LITMUS_PASSWORD ?? 'your-password', url: process.env.LITMUS_URL ?? 'https://company.litmus.com' }); api.getTests() .then(([response, body]) => { console.log('Response:', response); console.log('Body:', body); }) .catch(err => console.error('Error:', err));
Debug
Known issues
gotchagetTests() returns an array with response and body, not just body.
fix
Use array destructuring: const [response, body] = await api.getTests();
affects: >=0.0.0
gotchacreateVersion() for email tests returns a new email address; you must send an email to that address to trigger screenshots.
fix
After createVersion, check url_or_guid field and send email to that address.
affects: >=0.0.0
breakingAuthentication expects username and password, not API tokens.
fix
Pass username and password in options. For API tokens, use different client.
affects: >=0.0.0
deprecatedupdateTest() expects XML body; Litmus may be moving to JSON.
fix
Check Litmus API docs for current format.
affects: >=0.0.0
Errors
Common errors & fixes
TypeError: Litmus is not a constructor
Using named import instead of default import or incorrect require.
fix
Use const Litmus = require('litmus-api') or import Litmus from 'litmus-api'.
Cannot read property 'getTests' of undefined
Not waiting for promise resolution; api.getTests() is called without .then or async/await.
fix
Use await api.getTests() or .then() to handle the promise.
Error: Unauthorized
Invalid username, password, or URL.
fix
Verify credentials and URL format (e.g., https://yourcompany.litmus.com).
Upgrade
Version history
0.3.2latest on npm
Audit
Dependencies
bluebirdrequiredPromise library for async operations
Agent activity
9 hits · last 30 days
node
7
Amazon
1
OpenAI (training)
1
Resources
litmus-api — npm install litmus-api · libregistry