Skip to main content

SMS Providers

SMS providers for sending verification codes and MFA challenges.

Available Providers

ProviderPackageDescription
AWS SNS@nauth-toolkit/sms-aws-snsProduction SMS via AWS SNS or AWS End User Messaging SMS (configurable; supports configuration sets)
Console@nauth-toolkit/sms-consoleDevelopment (logs to console)

Provider Interface

All SMS providers implement SMSProvider:

interface SMSProvider {
sendOTP(
phone: string,
code: string,
templateType?: string,
variables?: Record<string, unknown>
): Promise<void>;
sendVerificationCode?(phone: string, code: string): Promise<void>;
setTemplateEngine?(engine: SMSTemplateEngine): void;
setGlobalVariables?(variables: SMSTemplateVariables): void;
}

Templates

Customize SMS message content with templates: