{"id":48448,"library":"mautic","title":"Mautic Node.js Client","description":"Unofficial Node.js bindings to the Mautic REST API (version 0.0.4). WIP, low maintenance cadence, limited functionality. Provides a client for contacts, segments, and companies. Key differentiators: asynchronous, promise-based, simple auth with username/password. Less mature than official Mautic PHP SDK but fills gap for Node.js users. Not for production use; security not hardened.","status":"active","version":"0.0.4","language":"javascript","source_language":"en","source_url":"https://github.com/FieldControl/mautic","tags":["javascript"],"install":[{"cmd":"npm install mautic","lang":"bash","label":"npm"},{"cmd":"yarn add mautic","lang":"bash","label":"yarn"},{"cmd":"pnpm add mautic","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"HTTP client for API requests","package":"axios","optional":false}],"imports":[{"note":"CommonJS only; no default export for ESM","wrong":"import Mautic from 'mautic'","symbol":"Mautic","correct":"const Mautic = require('mautic')"},{"note":"ESM usage requires default import (works in Node >=14 with --experimental-modules or bundler)","wrong":"import { Mautic } from 'mautic'","symbol":"Mautic","correct":"import Mautic from 'mautic'"},{"note":"Constructor expects object with baseUrl and auth","wrong":"new Mautic.Mautic(...)","symbol":"Client instance","correct":"new Mautic({ baseUrl: '...', auth: { username: '...', password: '...' } })"}],"quickstart":{"code":"const Mautic = require('mautic');\nrequire('dotenv').config();\n\nconst client = new Mautic({\n  baseUrl: process.env.MAUTIC_BASE_URL || 'http://localhost/api',\n  auth: {\n    username: process.env.MAUTIC_USERNAME || 'admin',\n    password: process.env.MAUTIC_PASSWORD || 'admin'\n  }\n});\n\nasync function run() {\n  try {\n    const contacts = await client.contacts.list();\n    console.log('Contacts:', JSON.stringify(contacts, null, 2));\n  } catch (err) {\n    console.error('Error:', err.message);\n  }\n}\nrun();","lang":"javascript","description":"Demonstrates initializing the client with environment variables and fetching contacts list."},"warnings":[{"fix":"Use Basic Auth credentials; configure Mautic to accept basic auth.","message":"Constructor requires 'auth' object with 'username' and 'password' - not API key or OAuth","severity":"breaking","affected_versions":">=0.0.1"},{"fix":"Wrap calls in async function or use .then().catch().","message":"All methods return promises, not callbacks. Must use await or .then()","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Access response.data (axios) or use the raw data as returned.","message":"Package does not parse Mautic's response envelop; returns raw axios response data","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Parse IDs with parseInt() before passing.","message":"Contact ID expected as integer, not string. Passing string may cause API errors","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Manually handle pagination with 'start' and 'limit' parameters.","message":"No pagination helper; list() returns only first page by default","severity":"gotcha","affected_versions":">=0.0.1"}],"env_vars":null,"search_vec":"'0.0.4':13 'api':11 'asynchron':30 'auth':35 'base':33 'bind':6 'cadenc':17 'client':3,22 'compani':27 'contact':24 'differenti':29 'fill':46 'function':19 'gap':47 'harden':57 'javascript':58 'key':28 'less':38 'limit':18 'low':15 'mainten':16 'matur':39 'mautic':1,9,42 'node.js':2,5,49 'offici':41 'php':43 'product':53 'promis':32 'promise-bas':31 'provid':20 'rest':10 'sdk':44 'secur':55 'segment':25 'simpl':34 'unoffici':4 'use':54 'user':50 'username/password':37 'version':12 'wip':14","created_at":"2026-06-07T16:56:41.707880+00:00","updated_at":"2026-06-07T16:56:41.707880+00:00","problems":[{"fix":"Ensure Mautic server is accessible and baseUrl is correct (e.g., 'http://localhost:8080/api')","cause":"Mautic instance not running or wrong baseUrl","error":"Error: connect ECONNREFUSED"},{"fix":"Use 'new Mautic(...)' or 'Mautic.default(...)' if using ES import","cause":"Mautic constructor called without new","error":"TypeError: Cannot read property 'contacts' of undefined"},{"fix":"Upgrade Node.js to >=10 or use var/function syntax","cause":"Old Node.js version (<10) not supporting ES6","error":"SyntaxError: Unexpected token 'const'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/FieldControl/mautic#readme","github":"https://github.com/FieldControl/mautic","docs":null,"changelog":null,"pypi":null,"npm":"mautic","openapi_spec":null,"status_page":null,"smithery":null,"categories":["crm"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}