The SDK works in edge/serverless runtimes that don't ship Node's http
module — such as Vercel Edge Functions, Cloudflare Workers, Next.js edge
routes and Deno. Requests automatically fall back to the fetch adapter
in those environments, while Node and browsers keep using their existing
adapters unchanged.
npm install @mailerlite/mailerlite-nodejs// For ECMAScript (ESM)
import MailerLite from '@mailerlite/mailerlite-nodejs';
const mailerlite = new MailerLite({
api_key: "API_KEY"
});// For CommonJS (CJS)
const MailerLite = require('@mailerlite/mailerlite-nodejs').default;
const mailerlite = new MailerLite({
api_key: "API_KEY"
});