@selldone/sdk-storefront
Version:
A TypeScript SDK to connect to your shop and build a fully functional storefront and website by simply developing a frontend web application. All backend operations are seamlessly managed by the serverless Selldone solution.
33 lines (32 loc) • 1.38 kB
TypeScript
import { XapiAuthSMS } from "@selldone/sdk-storefront/auth/sms/XapiAuthSMS";
/**
* Requests an OTP (One-Time Password) for phone-based authentication.
*
* This method sends a request to the specified endpoint to generate and send an OTP
* to the user's phone. It's typically used in two-factor authentication or phone number
* verification processes.
*
* @param {string | number} dial_code - The dial code of the country/region (e.g., +1 for the US).
* @param {string} country_code - The ISO code of the country (e.g., 'US' for the United States).
* @param {string | number} phone - The phone number to which the OTP should be sent.
*
* @returns {Promise<ISMSRequestOTPServerResponse>} - Returns a promise that resolves with the
* server's response to the OTP request.
*
* @example
*
* requestOTP('+1', 'US', '1234567890')
* .then(response => console.log(response))
* .catch(error => console.error(error));
*
*/
export default function XapiAuthSMSRequestOtp(this: XapiAuthSMS, dial_code: string | number, country_code: string, phone: string | number): Promise<XapiAuthSMSRequestOtpTypes.IResponse>;
export declare namespace XapiAuthSMSRequestOtpTypes {
/**
* The response returned by the requestOTP function.
*/
interface IResponse {
success: boolean;
phone: string;
}
}