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

# Send emails with Node.js

> Send a transactional email from Node.js with the official Apollo Signal TypeScript SDK

The TypeScript SDK provides a class-based client for Node.js. It sends requests to
`https://api.signal.apollodeploy.com` by default.

Before you start, [create an API key](/signal/create-an-api-key) with **Emails: Send** permission
and [verify the From domain](/signal/add-a-domain).

<Steps>
  <Step title="Install the SDK">
    ```bash theme={"dark"}
    npm install @apollo-deploy/signal-sdk
    ```
  </Step>

  <Step title="Store your API key">
    Set `SIGNAL_API_KEY` in your server environment. Never expose it to browser code.
  </Step>

  <Step title="Send an email">
    ```typescript theme={"dark"}
    import { ApolloSignalApi } from "@apollo-deploy/signal-sdk";

    const signal = new ApolloSignalApi();

    const email = await signal.emails.sendEmail(
      {
        from: "auth@mail.company.com",
        to: ["alex@example.com"],
        subject: "Reset your password",
        text: "Use the secure link in your account to choose a new password.",
      },
      {
        headers: {
          Authorization: `Bearer ${process.env.SIGNAL_API_KEY}`,
        },
      },
    );

    console.log(email.id);
    ```
  </Step>
</Steps>

<Note>
  `to`, `cc`, and `bcc` are arrays. Your `from` address must use a domain verified in the same Signal
  project as the API key.
</Note>

## Production use

* Reuse the client across requests.
* Add `idempotencyKey` when a job may retry the same logical send.
* Keep the key in a server-side secret manager.
* Use the returned ID or signed webhooks to follow delivery outcomes.

<CardGroup cols={2}>
  <Card title="All SDKs" icon="code" href="/signal/send-with/sdk-overview">
    Compare every supported language and framework.
  </Card>

  <Card title="Manage emails" icon="envelope" href="/signal/dashboard/emails/introduction">
    Understand message states and delivery timelines.
  </Card>
</CardGroup>
