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

# Node.js

> Send emails from Node.js using the SendKit SDK.

<CardGroup cols={2}>
  <Card title="Source Code" icon="github" href="https://github.com/sendkitdev/sendkit-node">
    View on GitHub
  </Card>

  <Card title="Package" icon="box" href="https://www.npmjs.com/package/@sendkitdev/sdk">
    View on npm
  </Card>
</CardGroup>

## Install

<CodeGroup>
  ```bash npm theme={null}
  npm install @sendkitdev/sdk
  ```

  ```bash yarn theme={null}
  yarn add @sendkitdev/sdk
  ```

  ```bash pnpm theme={null}
  pnpm add @sendkitdev/sdk
  ```
</CodeGroup>

## Send email

```typescript theme={null}
import { SendKit } from '@sendkitdev/sdk';

const sendkit = new SendKit('sk_your_api_key');

const { data, error } = await sendkit.emails.send({
  from: 'Your Name <you@yourdomain.com>',
  to: 'recipient@example.com',
  subject: 'Hello from SendKit',
  html: '<h1>Welcome!</h1><p>Your first email with SendKit.</p>',
});

if (error) {
  console.error(error);
} else {
  console.log('Email sent:', data.id);
}
```
