---
title: "OpenEmail for Bolt"
description: "Add email to the app you build with Bolt: one prompt, an API key and the OpenEmail SDK, with sending, threads and webhooks."
url: "https://openemail.uk/developers/bolt"
---

[All developer tools](https://openemail.uk/developers.md)

OpenEmail for Bolt

# Send emailwith Bolt.

Paste one prompt and Bolt adds a server route that sends with your OpenEmail key.

[Open Bolt](https://bolt.new)

Prompt for Bolt

```
Add transactional email to this app with OpenEmail.

1. Install the TypeScript SDK with npm install @openemail/sdk.
2. Read the API key from the OPENEMAIL_API_KEY environment variable, on the server only. Never send it to the browser and never commit it.
3. Write a sendEmail helper that calls init once, then openemail.emails.send. Send from an address on a domain verified in OpenEmail.
4. Put the send in a server route, never in browser code.
5. Pass an idempotencyKey built from the event, such as welcome:<userId>, so a retry never sends twice.
6. Send a welcome email when someone signs up, and log the id that comes back.

SDK reference: https://openemail.uk/docs/sdk
```

Change the sender and the trigger to fit your app. The rest is how OpenEmail expects to be called.

## Three steps, then it sends.

1. 01
   
   Mint a key
   
   Create a key that can send in Settings. The secret shows once.
2. 02
   
   Keep it secret
   
   Add OPENEMAIL\_API\_KEY to the secrets in Bolt, never to the code.
3. 03
   
   Paste the prompt
   
   Bolt installs the SDK and writes the send. Read the change, then run it.

## What it writes. One route, one call.

A typical result. Bolt may name the files differently.

server/index.ts

```
1import express from 'express'2import { init, openemail } from '@openemail/sdk'3 4init({ apiKey: process.env.OPENEMAIL_API_KEY })5 6const app = express()7app.use(express.json())8 9app.post('/api/send', async (req, res) => {10  const { email, name, userId } = req.body11 12  const sent = await openemail.emails.send({13    from: 'Acme <hello@acme.com>',14    to: email,15    subject: `Welcome, ${name}`,16    html: `<p>Thanks for signing up, ${name}.</p>`,17  }, {18    idempotencyKey: `welcome:${userId}`,19  })20 21  res.json({ id: sent.id })22})23 24app.listen(3000)
```

## Other tools same prompt, same mailbox.

- [Claude Code Coding agent Ask Claude Code to add sending to your codebase.](https://openemail.uk/developers/claude-code.md)
- [Cursor Coding agent Let the Cursor agent wire up sending in your repo.](https://openemail.uk/developers/cursor.md)
- [Codex Coding agent Hand Codex the prompt and review the change it makes.](https://openemail.uk/developers/codex.md)
- [GitHub Copilot Coding agent Paste the prompt into Copilot agent mode in VS Code.](https://openemail.uk/developers/github-copilot.md)
- [Windsurf Coding agent Let Cascade add sending to your project.](https://openemail.uk/developers/windsurf.md)
- [Gemini CLI Coding agent Run the prompt in Gemini CLI from your project folder.](https://openemail.uk/developers/gemini-cli.md)
- [T3 Code Coding agent Paste the prompt into a T3 Code thread and review the diff.](https://openemail.uk/developers/t3-code.md)
- [v0 App builder Add a send route to the Next.js app v0 builds.](https://openemail.uk/developers/v0.md)
- [Lovable App builder Send from a Supabase Edge Function in your Lovable app.](https://openemail.uk/developers/lovable.md)
- [Replit App builder Add an Express route that sends from your Replit app.](https://openemail.uk/developers/replit.md)
- [Modulify App builder Add a send route to the Next.js site Modulify builds.](https://openemail.uk/developers/modulify.md)

## Mint a key. Send something.

Full API, MCP and SDK access on every plan, the free one included.

[Open mail](https://openemail.uk/mail/inbox) [Get Started](https://openemail.uk/signup.md)[Read the API quickstart](https://openemail.uk/docs/api/quickstart.md)
