UNPKG

@msg91comm/react-native-sendotp

Version:

The SendOtp Verification SDK makes verifying phone numbers easy. SDK supports the verification of phone numbers via SMS & Calls.

47 lines (44 loc) 1.51 kB
export type ExposeMethodResponse = { message: string, type: 'success' | 'error', code?: string } export interface ExposeOTPVerificationRefProps { /** * Method to Send OTP. * * @param identifier `Phone number` with country code or `Email` * * @returns response of sending OTP * * @example * Country code of India is +91, * So, the identifier will be `919876543210` * * For email, * the identifier will be `xyz@gmail.com` * * @see https://msg91.com/help/MSG91/how-to-integrate-the-new-login-with-otp-widget */ sendOtp: (identifier : string) => Promise<ExposeMethodResponse> /** * Method to Retry OTP. * * @param retryChannel `SMS` or `VOICE` or `EMAIL` or `WHATSAPP` or nothing. * * If nothing is passed in the parameter, the OTP will be sent on the default channel set on the widget configuration. * * `Note`: To retry OTP on your desired channel, make sure you have set the right configuration on the widget. * * @returns response of Retry OTP. * * @see https://msg91.com/help/MSG91/how-to-integrate-the-new-login-with-otp-widget */ retryOtp: (retryOn? : 'SMS' | 'VOICE' | 'EMAIL' | 'WHATSAPP') => Promise<ExposeMethodResponse> /** * Method to Verify OTP. * * @param OTP Pass the received `OTP` * * @returns response of Verify OTP. * * @see https://msg91.com/help/MSG91/how-to-integrate-the-new-login-with-otp-widget */ verifyOtp: (otp : number) => Promise<ExposeMethodResponse> }