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.
Query parameters
Boolean query parameters are sent as 1 and 0, and Date values as YYYY-MM-DD in the caller's local time.
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"
});
- Subscribers
- Groups
- Segments
- Fields
- Automations
- List all automations
- Get an automation
- Get the subscriber activity for an automation
- Create draft automation
- Update an automation
- Delete automation
- Copy an automation
- Enable an automation
- Disable an automation
- Send an automation test email
- Add subscribers to an automation
- Re-add subscribers to an automation
- Copy automation subscribers to groups
- Cancel automation runs
- Skip an automation delay
- Automation triggers
- Automation steps
- Automation emails
- Automation templates
- Automation reports
- Get automation step run counts
- Get run counts for an automation step
- Get automation trigger run counts
- Get run counts for an automation trigger
- List automation A/B test stats
- Get automation A/B test stats
- List subscribers on an automation step
- List subscribers on an automation trigger
- List automation orders
- Get automation email totals
- Get automation e-commerce totals
- Campaigns
- Forms
- Batching
- Webhooks
- Timezones
- Campaign languages
- Stats
- Brand styles
- Files
