Skip to main content

SDKs

Official Lettr SDKs for all major programming languages.

Official SDKs

Framework Integrations

Node.js SDK

Installation

npm install lettr

Usage

import { Lettr } from 'lettr';

const lettr = new Lettr('your-api-key');

// Send email
const email = await lettr.emails.send({
  from: 'you@example.com',
  to: ['recipient@example.com'],
  subject: 'Hello',
  html: '<p>Hello World</p>'
});

// List emails
const emails = await lettr.emails.list({ limit: 10 });

// Get domains
const domains = await lettr.domains.list();

PHP SDK

Installation

composer require lettr/lettr-php

Usage

<?php

use Lettr\Lettr;

$lettr = new Lettr('your-api-key');

// Send email
$email = $lettr->emails->send([
    'from' => 'you@example.com',
    'to' => ['recipient@example.com'],
    'subject' => 'Hello',
    'html' => '<p>Hello World</p>'
]);

// List emails
$emails = $lettr->emails->list(['limit' => 10]);

Python SDK

Installation

pip install lettr

Usage

from lettr import Lettr

lettr = Lettr('your-api-key')

# Send email
email = lettr.emails.send(
    from_email='you@example.com',
    to=['recipient@example.com'],
    subject='Hello',
    html='<p>Hello World</p>'
)

# List emails
emails = lettr.emails.list(limit=10)

Go SDK

Installation

go get github.com/lettr/lettr-go

Usage

package main

import (
    "github.com/lettr/lettr-go"
)

func main() {
    client := lettr.New("your-api-key")

    email, err := client.Emails.Send(&lettr.SendEmailParams{
        From:    "you@example.com",
        To:      []string{"recipient@example.com"},
        Subject: "Hello",
        HTML:    "<p>Hello World</p>",
    })
}

SDK Features

All SDKs include:
FeatureDescription
Type definitionsFull TypeScript/type hints support
Error handlingStructured error responses
Automatic retriesRetry on transient failures
Webhook verificationBuilt-in signature verification
Rate limitingAutomatic rate limit handling

Contributing

SDKs are open source. Contributions welcome!

Contribution Guide

Learn how to contribute to our SDKs