{"library":"mailgun.js","title":"Mailgun.js","description":"Mailgun.js v13.0.0 is a JavaScript SDK for the Mailgun API, supporting Node.js (>=18) and browser environments with CJS, ESM, and AMD bundles. It provides a full client for sending emails, managing mailing lists, domains, suppressions, routes, tags, events, and more. Active development (12 releases in 2 years, monthly cadence). Key differentiators: first-class TypeScript support, explicit FormData passing (universal), subaccount support, and EU API endpoint configuration.","language":"javascript","status":"active","last_verified":"Sat Apr 25","install":{"commands":["npm install mailgun.js"],"cli":null},"imports":["import Mailgun from 'mailgun.js'","import { IMessagesClient } from 'mailgun.js'","import { MailMan } from 'mailgun.js'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import Mailgun from 'mailgun.js';\nimport FormData from 'form-data';\n\nconst mailgun = new Mailgun(FormData);\nconst mg = mailgun.client({\n  username: 'api',\n  key: process.env.MAILGUN_API_KEY ?? 'your-api-key',\n});\n\n// Send an email\nmg.messages.create('sandbox.mailgun.org', {\n  from: \"Excited User <mailgun@sandbox.mailgun.org>\",\n  to: [\"recipient@example.com\"],\n  subject: \"Hello\",\n  text: \"Testing some Mailgun awesomeness!\",\n}).then(msg => console.log(msg))\n.catch(err => console.error(err));\n\n// List mailing lists\nmg.lists.list().then(lists => console.log(lists))\n.catch(err => console.error(err));","lang":"typescript","description":"Initializes mailgun client with API key, sends an email, and lists all mailing lists.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}