@davidbolaji/termii-node
Version:
Node.js SDK for Termii API – send SMS, voice, OTP, and manage messaging with ease.
22 lines (21 loc) • 558 B
JavaScript
/**
* Service for generating in-app OTP tokens
*/
export class InAppTokenService {
constructor(http) {
this.http = http;
}
/**
* Generate a new in-app OTP token
*
* @param payload - Request payload containing apiKey, pinType, phoneNumber, and OTP settings
* @returns Expanded `InAppTokenResponse` with OTP details
*/
async generate(payload) {
return this.http.request("/sms/otp/generate", {
method: "POST",
data: payload,
authLocation: "body"
});
}
}