Skip to content

Latest commit

 

History

History
117 lines (105 loc) · 5.92 KB

File metadata and controls

117 lines (105 loc) · 5.92 KB


MailerLite logo


MailerLite Node.js SDK

MIT licensed NPM Version


Edge & serverless runtimes

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.

Installation

npm install @mailerlite/mailerlite-nodejs

Usage

// 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"
});