Skip to main content

SMSProvider

Package: @nauth-toolkit/core Type: Interface

Contract for sending SMS messages. Supports optional template integration via setTemplateEngine() and setGlobalVariables().

import { SMSProvider } from '@nauth-toolkit/nestjs';

Methods

MethodReturnsDescription
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)voidOptional hook for template rendering support
setGlobalVariables?(variables)voidOptional hook to set global template variables

Template Parameters

ParameterTypeRequiredDescription
templateTypestringNoTemplate key (e.g., verification, mfa, passwordReset)
variablesRecord<string, unknown>NoTemplate variables (e.g., expiryMinutes, appName, supportPhone)