> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lettr.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Getting Started

> Get started sending transactional emails from Node.js with the type-safe Lettr SDK, with guides for Next.js and Nuxt projects

Integrate Lettr into your Node.js application to send transactional emails. Choose the guide that matches your framework.

Using Cursor? [Jump straight in using this prompt](https://cursor.com/link/prompt?text=Help%20me%20add%20a%20Lettr%20sending%20example%20for%20Node.js%20%28Next.js%20or%20Nuxt%29%2C%20or%20migrate%20my%20current%20Node.js%20sending%20solution%20to%20Lettr%20using%20these%20docs%3A%20https%3A%2F%2Fdocs.lettr.com%2Fquickstart%2Fnodejs%2Fintroduction)

## Prerequisites

Before you begin, make sure you have:

1. A Lettr account — [sign up at app.lettr.com](https://app.lettr.com)
2. An [API key](/learn/api-keys/introduction) created in your dashboard
3. A [verified sending domain](/learn/domains/introduction)
4. Node.js 18 or higher

## The SDK

The official `lettr` package is the recommended way to use Lettr from Node.js — a type-safe client that returns a `Result` (`{ data, error }`) instead of throwing:

```typescript theme={null}
import { Lettr } from "lettr";

const client = new Lettr(process.env.LETTR_API_KEY!);

const { data, error } = await client.emails.send({
  from: "you@yourdomain.com",
  to: ["recipient@example.com"],
  subject: "Hello from Lettr",
  html: "<p>Your email content here.</p>",
});

if (error) throw new Error(error.message);
console.log(data.request_id);
```

### SDK Guides

| Page                                                | What You'll Learn                                      |
| --------------------------------------------------- | ------------------------------------------------------ |
| [Installation](/quickstart/nodejs/installation)     | Install, create a client, and the Result pattern       |
| [Sending Emails](/quickstart/nodejs/sending-emails) | HTML, text, templates, attachments, scheduling, errors |
| [Templates](/quickstart/nodejs/templates)           | Manage Lettr templates and merge tags                  |
| [Domains](/quickstart/nodejs/domains)               | Add, verify, and manage sending domains                |
| [Webhooks](/quickstart/nodejs/webhooks)             | Manage webhook endpoints                               |
| [Audience](/quickstart/nodejs/audience)             | Lists, contacts, topics, properties, segments          |
| [Campaigns](/quickstart/nodejs/campaigns)           | List, send, and schedule campaigns                     |

## Framework Guides

<CardGroup cols={2}>
  <Card title="Next.js" icon="react" href="/quickstart/nodejs/nextjs">
    Send emails from Next.js API routes and server components
  </Card>

  <Card title="Nuxt" icon="vuejs" href="/quickstart/nodejs/nuxt">
    Integrate Lettr with Nuxt server routes
  </Card>
</CardGroup>

## Direct API Usage

If you'd rather not add a dependency, send via the REST API using `fetch`:

```javascript theme={null}
const apiKey = 'lttr_xxxxxxxxxxxx';

const response = await fetch('https://app.lettr.com/api/emails', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${apiKey}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    from: 'you@yourdomain.com',
    to: ['recipient@example.com'],
    subject: 'Hello from Lettr',
    html: '<p>Your email content here.</p>',
  }),
});

const data = await response.json();
console.log(data);
```

For the full API reference, see the [Send Email endpoint](/api-reference/emails/send-email).
