Providers

Amazon SES

Send email through Amazon SES.
import { createClient } from '@nicogenz/emails-sdk';
import { ses } from '@nicogenz/emails-sdk/ses';

const email = createClient({
  provider: ses({
    region: 'eu-central-1',
    accessKeyId: process.env.AWS_ACCESS_KEY_ID!,
    secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY!,
  }),
});

Options

OptionTypeRequiredDescription
regionstringYesThe AWS region your SES identities are in.
accessKeyIdstringYesThe access key ID of an IAM user or role.
secretAccessKeystringYesThe matching secret access key.
sessionTokenstringNoThe session token for temporary credentials.
configurationSetNamestringNoThe SES configuration set to send with.
fetchtypeof fetchNoA custom fetch implementation.

The credentials need permission for the ses:SendEmail action.

Credentials

The provider doesn't look up AWS credentials on its own. Pass them in explicitly, for example from the environment variables that AWS Lambda sets:

ses({
  region: process.env.AWS_REGION!,
  accessKeyId: process.env.AWS_ACCESS_KEY_ID!,
  secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY!,
  sessionToken: process.env.AWS_SESSION_TOKEN,
});

Notes

  • Requests go to the SES v2 API and are signed with AWS Signature Version 4.
  • tags are sent as SES EmailTags. SES only allows ASCII letters, numbers, underscores and dashes in tag names and values.
  • headers are limited to 15 per email by SES.
  • idempotencyKey isn't supported. Passing one throws an EmailError with the code unsupported.
  • sendBatch sends the emails one by one, because the SES bulk endpoint only works with stored templates.
Copyright © 2026