{"id":18500,"library":"litmus-api","title":"litmus-api","description":"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.","status":"active","version":"0.3.2","language":"javascript","source_language":"en","source_url":"git://github.com/jeremypeter/litmus-api","tags":["javascript","litmus","email","promise","api"],"install":[{"cmd":"npm install litmus-api","lang":"bash","label":"npm"},{"cmd":"yarn add litmus-api","lang":"bash","label":"yarn"},{"cmd":"pnpm add litmus-api","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Promise library for async operations","package":"bluebird","optional":false}],"imports":[{"note":"CommonJS require pattern works; ESM import is possible if module resolution supports it.","wrong":"const litmus = require('litmus-api')","symbol":"default","correct":"import Litmus from 'litmus-api'"},{"note":"The package exports a constructor as default, not a named export.","wrong":"const { Litmus } = require('litmus-api')","symbol":"Litmus","correct":"const Litmus = require('litmus-api')"},{"note":"Named import does not work; use default import.","wrong":"import { Litmus } from 'litmus-api'","symbol":"Litmus","correct":"import Litmus from 'litmus-api'"}],"quickstart":{"code":"const Litmus = require('litmus-api');\n\nconst api = new Litmus({\n  username: process.env.LITMUS_USERNAME ?? 'your-username',\n  password: process.env.LITMUS_PASSWORD ?? 'your-password',\n  url: process.env.LITMUS_URL ?? 'https://company.litmus.com'\n});\n\napi.getTests()\n  .then(([response, body]) => {\n    console.log('Response:', response);\n    console.log('Body:', body);\n  })\n  .catch(err => console.error('Error:', err));\n","lang":"javascript","description":"Shows how to instantiate the Litmus client with credentials and fetch a list of tests."},"warnings":[{"fix":"Use array destructuring: const [response, body] = await api.getTests();","message":"getTests() returns an array with response and body, not just body.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"After createVersion, check url_or_guid field and send email to that address.","message":"createVersion() for email tests returns a new email address; you must send an email to that address to trigger screenshots.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Pass username and password in options. For API tokens, use different client.","message":"Authentication expects username and password, not API tokens.","severity":"breaking","affected_versions":">=0.0.0"},{"fix":"Check Litmus API docs for current format.","message":"updateTest() expects XML body; Litmus may be moving to JSON.","severity":"deprecated","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Use const Litmus = require('litmus-api') or import Litmus from 'litmus-api'.","cause":"Using named import instead of default import or incorrect require.","error":"TypeError: Litmus is not a constructor"},{"fix":"Use await api.getTests() or .then() to handle the promise.","cause":"Not waiting for promise resolution; api.getTests() is called without .then or async/await.","error":"Cannot read property 'getTests' of undefined"},{"fix":"Verify credentials and URL format (e.g., https://yourcompany.litmus.com).","cause":"Invalid username, password, or URL.","error":"Error: Unauthorized"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}