SMSProvider
Package: @nauth-toolkit/core
Type: Interface
Contract for sending SMS messages. Supports optional template integration via setTemplateEngine() and setGlobalVariables().
- NestJS
- Express
- Fastify
import { SMSProvider } from '@nauth-toolkit/nestjs';
import { SMSProvider } from '@nauth-toolkit/core';
import { SMSProvider } from '@nauth-toolkit/core';
Methods
| Method | Returns | Description |
|---|---|---|
sendOTP(phone, code, templateType?, variables?) | Promise<void> | Send OTP code (optionally rendered via templates) |
sendVerificationCode?(phone, code) | Promise<void> | Optional alias for sendOTP() |
setTemplateEngine?(engine) | void | Optional hook for template rendering support |
setGlobalVariables?(variables) | void | Optional hook to set global template variables |
Template Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
templateType | string | No | Template key (e.g., verification, mfa, passwordReset) |
variables | Record<string, unknown> | No | Template variables (e.g., expiryMinutes, appName, supportPhone) |
Related APIs
- SMSTemplateEngine - Template engine contract
- SMS Templates Configuration - Configuration API
- SMS Providers Overview - Provider implementations