react-native-freeotp
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

react-native-freeotp

Native module for generating the same TOTP tokens as FreeOTP from your React Native app.

Installation

npm install react-native-freeotp

Android

Rebuild the app.

iOS

Install the pod, then rebuild the app.

npx pod-install

Usage

import FreeOtp from 'react-native-freeotp';

const tokenPair = await FreeOtp.getTokenPair(totpUrl);

Types

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;
};

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

Package Sidebar

Install

npm i react-native-freeotp

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

137 kB

Total Files

33

Last publish

Collaborators

  • osamaq