Gathering detailed insights and metrics for react-native-otp-verify
Gathering detailed insights and metrics for react-native-otp-verify
Gathering detailed insights and metrics for react-native-otp-verify
Gathering detailed insights and metrics for react-native-otp-verify
react-native-otp-entry
A fully modifiable OTP Input Component for React Native
react-native-input-code-otp
react-native-input-code-otp is a high-performance and fully customizable OTP input component for React Native, inspired by @shadcn/ui.
react-native-verify-otp-inputs
react-native-verify-otp is a tiny Javascript library which provides an elegant UI for the end user to input OTP
react-native-otp-verify-remastered
Verify SMS messages natively through React-Native without requiring additional permissions.
React native sms verification without additional permissions
npm install react-native-otp-verify
Typescript
Module System
Node Version
NPM Version
Java (64.35%)
TypeScript (17.05%)
Objective-C (9.89%)
JavaScript (4.53%)
Ruby (3.67%)
C (0.32%)
Swift (0.19%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
275 Stars
57 Commits
101 Forks
5 Watchers
3 Branches
18 Contributors
Updated on Jun 16, 2025
Latest Version
1.1.8
Package Id
react-native-otp-verify@1.1.8
Unpacked Size
392.54 kB
Size
122.84 kB
File Count
102
NPM Version
8.19.2
Node Version
16.18.1
Published on
Feb 16, 2024
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
2
19
Automatic SMS Verification with the SMS Retriever API, you can perform SMS-based user verification in your Android app automatically, without requiring the user to manually type verification codes, and without requiring any extra app permissions.
In order to detect the message, SMS message must include a hash that identifies your app. This hash can be obtained by using the getHash() method below.
Please read the official documentation for the message structure at this Google developer guide
$ npm install react-native-otp-verify --save
or
$ yarn add react-native-otp-verify
1import { 2 getHash, 3 startOtpListener, 4 useOtpVerify, 5} from 'react-native-otp-verify';
1 2// You can use the startListener and stopListener to manually trigger listeners again. 3// optionally pass numberOfDigits if you want to extract otp 4const { hash, otp, message, timeoutError, stopListener, startListener } = useOtpVerify({numberOfDigits: 4});
Property | Type | Description |
---|---|---|
hash | string[] | The hash code for the application which should be added at the end of message. |
otp | string | OTP retreived from SMS when received. (Must pass numberOfDigits ) |
message | string | SMS message when received. |
timeoutError | boolean | Flag is set to true when after timeout (5 minutes) Check here |
startListener | function | Manually starts listener again in case of timeout or any other error |
stopListener | function | Stops listener for the sms |
1// using methods 2useEffect(() => { 3 getHash().then(hash => { 4 // use this hash in the message. 5 }).catch(console.log); 6 7 startOtpListener(message => { 8 // extract the otp using regex e.g. the below regex extracts 4 digit otp from message 9 const otp = /(\d{4})/g.exec(message)[1]; 10 setOtp(otp); 11 }); 12 return () => removeListener(); 13}, []);
See the example app in example
folder.
Linking the package manually is not required anymore with Autolinking.
android/app/src/main/java/[...]/MainActivity.java
import com.faizal.OtpVerify.OtpVerifyPackage;
to the imports at the top of the filenew OtpVerifyPackage()
to the list returned by the getPackages()
methodandroid/settings.gradle
:
1include ':react-native-otp-verify' 2project(':react-native-otp-verify').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-otp-verify/android')
android/app/build.gradle
:
1 implementation project(':react-native-otp-verify')
requestHint: () => Promise<string>
Gets phone number in a frictionless way to show a user’s (SIM-based) phone numbers as a hint. Check here
startOtpListener(handler:(message:string)=>any):Promise<Subscription>
Start listening for OTP/SMS and adds listener for the handler passed which is called when message is received..
getOtp():Promise<boolean>
Start listening for OTP/SMS. Return true if listener starts else throws error.
getHash():Promise<string[]>
Gets the hash code for the application which should be added at the end of message. This is just a one time process.
addListener(handler:(message:string)=>any):Subscription
Adds a javascript listener to the handler passed which is called when message is received.
removeListener():void
Removes all listeners.
No vulnerabilities found.
Reason
license file detected
Details
Reason
binaries present in source code
Details
Reason
Found 8/23 approved changesets -- score normalized to 3
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
26 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More