Skip to main content
Use the official Node.js SDK to call the MailGlyph API from server-side apps.

Prerequisites

Before you start, make sure you have:
  • A MailGlyph secret API key (sk_...) for server-side API requests
  • A MailGlyph public API key (pk_...) for event tracking (/v1/track)
  • At least one verified sending domain for email sending
Setup links:

Install

Initialize clients

Create one SDK client for your secret key and one for your public key:
Set the environment variables:

Configure base URL and timeout

Use this when testing against staging or local environments:

Check key type at runtime

The SDK exposes keyType so you can enforce usage in your app:

Next pages