@wraps.dev/sms SDK lets you send SMS messages from your application using infrastructure you own in AWS. It authenticates with your AWS account using the same credential patterns as the email SDK — no Wraps credentials are stored.
Prerequisites
Before using the SDK, deploy SMS infrastructure to your AWS account:Installation
Quick example
Phone numbers must be in E.164 format: a
+ followed by country code and number, e.g. +14155551234.Authentication
The SDK resolves AWS credentials automatically. Choose the method that fits your deployment environment.Default credential chain (recommended)
When you constructWrapsSMS() with no arguments, the SDK resolves credentials in this order:
- Environment variables (
AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY) ~/.aws/credentialsfile- IAM role attached to the running compute (Lambda, EC2, ECS, etc.)
OIDC (Vercel, EKS, GitHub Actions)
For OIDC-based environments, pass the IAM role ARN created bywraps sms init. The SDK exchanges the OIDC token for temporary credentials automatically.
Explicit credentials
Pass credentials directly. Use environment variables — never hard-code secrets.Constructor options
AWS region where your SMS infrastructure is deployed. Defaults to the region
resolved from your AWS credentials or environment.
IAM role ARN to assume via OIDC. Required when deploying to Vercel, GitHub
Actions, or other OIDC-compatible environments.
Explicit AWS credentials. Provide
accessKeyId and secretAccessKey.
Use environment variables to avoid hard-coding secrets.Next steps
Sending messages
Learn how to send single and batch SMS messages, including message types and sandbox mode.
Opt-out management
Check, add, and remove opt-outs to stay compliant with SMS regulations.
