# SendGrid (/docs/adapters/sendgrid)



<ProviderBadge adapter="sendgrid" />

```ts
import { createEmailClient } from "email-sdk";
import { sendgrid } from "email-sdk/sendgrid";

const email = createEmailClient({
  adapters: [sendgrid({ apiKey: process.env.SENDGRID_API_KEY! })],
});
```

## Options [#options]

| Option    | Type           | Required | Notes                                   |
| --------- | -------------- | -------- | --------------------------------------- |
| `apiKey`  | `string`       | Yes      | SendGrid API key.                       |
| `baseUrl` | `string`       | No       | Defaults to `https://api.sendgrid.com`. |
| `fetch`   | `typeof fetch` | No       | Useful for tests or custom runtimes.    |

See <a href="/docs/adapters/field-support">field support</a> for headers, tags, metadata, and attachments.

## CLI [#cli]

```bash
email-sdk send --adapter sendgrid --from hello@example.com --to user@example.com --subject "Hello" --text "It works"
```
