@davidbolaji/termii-node
Version:
Node.js SDK for Termii API – send SMS, voice, OTP, and manage messaging with ease.
26 lines (25 loc) • 730 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.EmailTokenService = void 0;
/**
* Service for handling Email OTP operations
*/
class EmailTokenService {
constructor(http) {
this.http = http;
}
/**
* Send an OTP to a user's email address
*
* @param payload - Request payload containing API key, email, code, and config ID
* @returns Expanded `SendEmailTokenResponse` with details about the sent OTP
*/
async sendEmailToken(payload) {
return this.http.request("/email/otp/send", {
method: "POST",
data: payload,
authLocation: "body"
});
}
}
exports.EmailTokenService = EmailTokenService;