Native module for generating the same TOTP tokens as FreeOTP from your React Native app.
npm install react-native-freeotp
Rebuild the app.
Install the pod, then rebuild the app.
npx pod-install
import FreeOtp from 'react-native-freeotp';
const tokenPair = await FreeOtp.getTokenPair(totpUrl);
Result:
type TokenPair = {
/**
* Current token.
*/
tokenOne: string;
/**
* Next period step token.
*/
tokenTwo: string;
/**
* Seconds until expiry of the current token.
*/
tokenOneExpires: string;
/**
* Seconds until expiry of the next token.
*/
tokenTwoExpires: string;
};
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT