@wraps.dev/email SDK lets you send transactional email through AWS SES infrastructure that you deployed with wraps email init. Your AWS account owns all the resources — Wraps never stores your credentials or touches your data.
You must deploy email infrastructure before using this SDK. Run
npx @wraps.dev/cli email init first.Installation
Prerequisites
- Email infrastructure deployed via
wraps email init - A verified domain (run
wraps email domains verify -d yourdomain.comto confirm) - AWS credentials available in your environment
Quick start
Authentication
The SDK resolves credentials using one of three methods. Use the default credential chain unless you have a specific reason to pass credentials explicitly.1. Default credential chain (recommended)
Pass no credentials. The SDK resolves them automatically in order: environment variables →~/.aws/credentials → IAM role attached to the instance or container.
2. OIDC for Vercel, EKS, or GitHub Actions
Pass aroleArn to have the SDK assume an IAM role using OIDC. This is the recommended approach for Vercel deployments and Kubernetes workloads.
3. Explicit credentials
Pass credentials directly. Useful for local testing or environments where the credential chain is unavailable.Constructor options
AWS region where your SES infrastructure is deployed (e.g.
'us-east-1'). Defaults to the AWS_REGION environment variable.ARN of an IAM role to assume via OIDC before sending. Use this for Vercel, EKS, or GitHub Actions deployments.
Explicit AWS credentials. Provide both
accessKeyId and secretAccessKey. Optionally include sessionToken for temporary credentials.A pre-configured
SESClient instance from @aws-sdk/client-ses. Use this when you need full control over the SES client, such as in two-step OIDC role assumption flows.Next steps
Sending
Send emails with HTML, plain text, React components, and attachments.
Templates
Create reusable SES templates and send bulk email.
Error handling
Handle validation errors, SES errors, and common failure modes.
