Skip to main content

Official Client SDKs

To make integration easier and more efficient, we provide an official SDK in TypeScript, Java and more. This library simplifies API interactions by handling request formatting, authentication, and error handling for you, allowing you to focus on your application rather than managing API communication. The TypeScript SDK includes:
  • Simple setup and configuration
  • Type-safe methods for all available API endpoints
  • Built-in retry logic for transient failures
  • Automatic error handling with clear exception messages

TypeScript

The TypeScript SDK is perfect for web applications or backend services built with Node.js, Bun and more, offering a streamlined and robust integration experience.

Default usage

import Nuntly from '@nuntly/sdk';

const client = new Nuntly({
  apiKey: process.env['NUNTLY_API_KEY'],
});

async function sendEmail() {
  const email = await client.emails.send({
    from: '[email protected]',
    to: '[email protected]',
    subject: 'Verify Your Email Address',
    text: 'Thank you for signing up! Please verify your email address...',
  });

  console.log(email.id);
}

sendEmail();

Use async/await without all the try catch blocks

const client = createSafeNuntly({ apiKey: NUNTLY_API_KEY });

async function sendEmail() {
  const { data, error } = await client.emails.send({
    from: '[email protected]',
    to: '[email protected]',
    subject: 'Verify Your Email Address',
    text: 'Thank you for signing up! Please verify your email address...',
  });

  if (error) {
    console.log(error.status); // 400
    console.log(error.details);
    // ...
  }

  console.log(data.id);
}

sendEmail();