# Quickstart

> Get started with Stack0 in under 5 minutes. Install the SDK, set your API key, and send your first email with this step-by-step guide.

Get started with Stack0 in under 5 minutes. This guide will walk you through sending your first email.

1

## Install the SDK

Install the Stack0 SDK using your preferred package manager:

npmCopy

```
npm install @stack0/sdk
```

yarnCopy

```
yarn add @stack0/sdk
```

pnpmCopy

```
pnpm add @stack0/sdk
```

bunCopy

```
bun add @stack0/sdk
```

2

## Set Your API Key

Add your API key to your environment variables. Get your key from the [Dashboard](https://app.stack0.dev/).

.envCopy

```
STACK0_API_KEY=sk_live_your_api_key
```

3

## Send Your First Email

Initialize the SDK and send an email:

send-email.tsCopy

```
import { Stack0 } from '@stack0/sdk' const stack0 = new Stack0({  apiKey: process.env.STACK0_API_KEY!}) const result = await stack0.mail.send({  from: 'you@yourdomain.com',  to: 'recipient@example.com',  subject: 'Hello from Stack0!',  html: '<h1>Welcome!</h1><p>This is your first email.</p>',}) console.log('Email sent!', result.id)
```

4

## Verify Your Domain (Optional)

For production use, verify your domain to improve deliverability. Go to your [Dashboard](https://app.stack0.dev/) and follow the domain verification steps.

### You're all set!

You've successfully sent your first email with Stack0. Explore the SDK examples to learn about templates, batch sending, and more.

## Next Steps

[Email Examples Templates, batch, broadcast](https://www.stack0.dev/docs/sdk/email)

[CDN & Storage Upload and serve files](https://www.stack0.dev/docs/sdk/cdn)

[Next.js Guide App Router integration](https://www.stack0.dev/docs/frameworks/nextjs)

[API Reference Full endpoint docs](https://www.stack0.dev/docs/api-reference)

---

Source: https://www.stack0.dev/docs/quickstart
llms.txt: https://www.stack0.dev/llms.txt
Sitemap: https://www.stack0.dev/sitemap.xml
Documentation: https://www.stack0.dev/docs
OpenAPI spec: https://www.stack0.dev/openapi.json
MCP server: https://api.stack0.dev/mcp
