Node.js and TypeScript
Call Easymailing from a Node.js backend with the official SDK.
The @easymailing/sdk package supports Node.js 20 and later and uses ESM imports.
Run it on your backend, where API credentials can remain private.
Install
npm install @easymailing/sdk@0.4.0List audiences
Set EASYMAILING_API_KEY in your server environment, then create a client:
import { Easymailing } from '@easymailing/sdk';
const apiKey = process.env.EASYMAILING_API_KEY;
if (!apiKey) throw new Error('EASYMAILING_API_KEY is required');
const client = new Easymailing({ apiKey });
const page = await client.audiences.list({ page: 1 });
for (const audience of page.data) {
console.log(audience.iri, audience.title);
}