Sending your first email
Install the SDK, then call emails.send with
a sender, a recipient and some HTML.
Use onboarding@resend.dev as the sender
while you test.
Install
npm install resend
Write your guides in MDX and bring your OpenAPI spec. Ariadocs turns both into pages, with one set of React components.
@ariadocs/mdx
Put .mdx files in a folder. Each one becomes a page with its frontmatter, its table of contents and your own components.
---
title: Sending your first email
---
Install the SDK, then call `emails.send` with
a sender, a recipient and some HTML.
<Callout type="tip">
Use `onboarding@resend.dev` as the sender
while you test.
</Callout>
## Install
```bash
npm install resend
```
import { createDocs } from "@ariadocs/mdx";
const docs = createDocs({ contentDir: "content/docs" });
const { MDX, frontmatter, toc } = await docs.parse({
slug: "first-email",
});Result
Install the SDK, then call emails.send with
a sender, a recipient and some HTML.
Use onboarding@resend.dev as the sender
while you test.
npm install resend
@ariadocs/openapi
Point it at a JSON or YAML spec. Every endpoint becomes typed data, and the components turn it into a page. This is Resend's real spec.
paths:
/emails/{email_id}:
get:
operationId: emails/get
tags:
- Emails
summary: Retrieve a single email
parameters:
- name: email_id
in: path
required: true
schema:
type: string
description: The ID of the email.<OpenAPI.Root api={await openapi.parse()}>
<OpenAPI.Operation id="emails-get">
<OpenAPI.Operation.Title />
<OpenAPI.Operation.Header />
<OpenAPI.Operation.Parameters />
</OpenAPI.Operation>
</OpenAPI.Root>Result
https://api.resend.com/emails/{email_id}The ID of the email.
@ariadocs/components
Both packages return navigation in the same format. Merge them and one component renders your guides and your endpoints.
const sidebar = [
...(await docs.getNavigation()),
...(await openapi.getNavigation()),
];
<Docs.Nav items={sidebar} />Result