{"id":14708,"library":"mixmax-api","title":"Mixmax API Client","description":"The `mixmax-api` library is a Node.js wrapper that provides a programmatic interface for interacting with the Mixmax platform. It simplifies common operations such as managing email sequences, adding recipients, and leveraging features like polls, Q&A, and sidebars within Mixmax. The current stable version is 1.5.0, with the last release dating back to December 2020. This indicates a slow or paused release cadence, meaning new Mixmax API features might not be immediately supported by this library. Its primary differentiator is offering a convenient JavaScript interface over the raw Mixmax REST API, which is designed for lightweight, real-time interactions and has a rate limit of 120 requests per minute per user and IP address.","status":"maintenance","version":"1.5.0","language":"javascript","source_language":"en","source_url":"https://github.com/ttacon/mixmax-api","tags":["javascript","mixmax","api"],"install":[{"cmd":"npm install mixmax-api","lang":"bash","label":"npm"},{"cmd":"yarn add mixmax-api","lang":"bash","label":"yarn"},{"cmd":"pnpm add mixmax-api","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The library primarily uses CommonJS `require` syntax as demonstrated in its documentation. While Node.js supports ESM, this package is not explicitly set up for it, and a direct `import` might not work as expected without transpilation or specific Node.js configuration for CJS interoperability.","wrong":"import MixmaxAPI from 'mixmax-api';","symbol":"MixmaxAPI","correct":"const MixmaxAPI = require('mixmax-api');"},{"note":"Although the package is not explicitly designed for ESM, if your project is pure ESM, you might be able to import it as a default export, potentially requiring `--experimental-json-modules` in Node.js or a build step to handle CJS modules. Named imports are generally incorrect for modules exporting a single constructor/class via CommonJS `module.exports = ...`.","wrong":"import { MixmaxAPI } from 'mixmax-api';","symbol":"MixmaxAPI (ESM approximation)","correct":"import MixmaxAPI from 'mixmax-api'; // May require Node.js `--experimental-json-modules` or build step"}],"quickstart":{"code":"const MixmaxAPI = require('mixmax-api');\n\n// IMPORTANT: Replace with your actual Mixmax API key from settings.\n// You can retrieve this key from your Mixmax settings page (Settings -> Integrations -> API).\n// Do NOT hardcode in production; use environment variables.\nconst apiKey = process.env.MIXMAX_API_KEY ?? 'YOUR_SUPER_SECRET_MIXMAX_API_KEY'; \n\nif (!apiKey || apiKey === 'YOUR_SUPER_SECRET_MIXMAX_API_KEY') {\n  console.error('Mixmax API Key is missing. Please set the MIXMAX_API_KEY environment variable or replace the placeholder.');\n  process.exit(1);\n}\n\nconst api = new MixmaxAPI(apiKey);\n\nasync function addRecipientToSequence() {\n  // Replace with an actual sequence ID from your Mixmax account\n  const sequenceID = 'your-mixmax-sequence-id'; \n  const recipientEmail = 'test-recipient@example.com';\n\n  try {\n    const sequence = api.sequences.sequence(sequenceID);\n    const results = await sequence.addRecipients([\n      {\n        email: recipientEmail,\n        variables: {\n          firstName: 'Test',\n          lastName: 'User'\n        }\n      }\n    ]);\n    console.log('Successfully added recipient to sequence:', results);\n  } catch (error) {\n    console.error('Error adding recipient to sequence:', error.message);\n    if (error.response && error.response.data) {\n      console.error('API Error Details:', error.response.data);\n    }\n  }\n}\n\naddRecipientToSequence();","lang":"javascript","description":"This quickstart demonstrates how to initialize the Mixmax API client with an API key and then add a new recipient to a specified email sequence. It highlights the basic authentication and sequence management functionality."},"warnings":[{"fix":"Ensure you are using `mixmax-api` version 1.3.0 or higher. Regularly test API interactions after any Mixmax platform updates or if you experience unexpected errors with older library versions.","message":"Version 1.3.0 included a fix to 'update HTTP calls to use new format'. While described as a fix, this indicates changes to the underlying Mixmax API or how the wrapper interacts with it. Older versions might experience connectivity issues or incorrect behavior if the Mixmax API has since diverged significantly.","severity":"breaking","affected_versions":">=1.3.0"},{"fix":"Review the official Mixmax Developer Portal and API documentation for any features or endpoints not covered by this library. Be prepared to directly use the Mixmax REST API for new functionalities or if this wrapper becomes incompatible with future Mixmax changes.","message":"The package has not been updated since December 2020. This means it may not support newer features of the Mixmax platform or gracefully handle recent changes to the Mixmax API. The official Mixmax API documentation continues to be updated, suggesting potential discrepancies.","severity":"gotcha","affected_versions":">=1.5.0 (due to lack of further updates)"},{"fix":"Implement proper error handling and retry mechanisms with exponential backoff for rate limit errors. Monitor your API usage and design your application to respect these limits, especially for bulk operations. Check the `Retry-After` header in error responses.","message":"Mixmax API requests are subject to rate limits (120 requests per minute per user and IP address). Exceeding these limits will result in errors.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Always store your Mixmax API key securely, preferably using environment variables or a secret management service, especially in production environments. Never hardcode API keys directly into your source code. Regenerate the key if you suspect it has been compromised.","message":"Authentication requires an API key, which must be obtained from your Mixmax settings page. Improper handling or exposure of this key can lead to unauthorized access to your Mixmax data.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Verify that your `MIXMAX_API_KEY` is correct and active. Ensure it's retrieved from your Mixmax settings (Settings > Integrations > API Token) and passed correctly to the `MixmaxAPI` constructor.","cause":"Invalid or missing Mixmax API key provided during client initialization. The API token might be incorrect, expired, or have insufficient permissions.","error":"Error: Request failed with status code 401"},{"fix":"Double-check the `sequenceID` used in your code against your Mixmax dashboard. Ensure the API key corresponds to a Mixmax account that has permission to access that specific sequence.","cause":"The provided sequence ID does not exist, or the authenticated user does not have access to it.","error":"Error: Request failed with status code 404 - Sequence not found"},{"fix":"Implement rate limiting on your client-side application or use a retry-with-backoff strategy to handle `429` responses. Respect the `Retry-After` header if provided in the API response.","cause":"Your application has exceeded the Mixmax API rate limits (120 requests per minute per user and IP address).","error":"Error: Request failed with status code 429 - Too Many Requests"},{"fix":"Ensure `const api = new MixmaxAPI(apiKey);` executed successfully and `apiKey` was valid. Verify the correct casing and property names (`sequences`, `sequence`). If updating, check the changelog for breaking changes related to the client's structure.","cause":"This error typically occurs if the `api` object was not correctly initialized with a `MixmaxAPI` instance, or if there's a typo in `sequences` or `sequence`. It could also indicate a fundamental change in the library's API if using an incompatible version.","error":"TypeError: api.sequences.sequence is not a function"}],"ecosystem":"npm"}