Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-native-biometry-module

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-biometry-module

## A UI library support biometry authentication with passcode fallback for React Native

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

react-native-biometry-module

A UI library support biometry authentication with passcode fallback for React Native

Installation

yarn add git+https://github.com/dangttp97/rn-biometry-module 

Example

import {Biometry, ScreenType} from 'react-native-biometry-module'

/*
Your render method
*/

return <Biometry type={ScreenType.select} biometryEnabled />

Enumerations

ScreenType

Type of screen to show. Includes:

  • select Set passcode screen.
  • input Input passcode screen.
  • changePasscode Change passcode screen.

Props

  • Generals
KeyTypeDefaultDescription
typeScreenTypeType of screen to display
numberOfAttemptsnumber
undefined
3Number of max attempts before screen is locked
lockedTimenumber
undefined
300000Locked time in millisecond before screen unlocked.
alphabetCharsVisibleboolean
undefined
falseIs alphabet characters show below numeric char in keypad
biometryEnabledbooleanIs using biometry for authenticate user
passcodeVisibleboolean
undefined
falseIs passcode input visible
timePasscodeLockedAsyncStorageNamestring
undefined
undefinedLocked time AsyncStorage save key
passcodeKeychainNamestring
undefined
undefinedKey for saving passcode to keychain system
passcodeAttemptsAsyncStorageNamestring
undefined
undefinedKey for saving number of failed attempts in AsyncStorage
onSuccess(passcode: string) => void
undefined
undefinedHandler for confirm passcode success, input passcode success, biometry success
onFailed(error?: any) => void
undefined
undefinedHandler for confirm failed, input passcode failed, biometry failed
passcodeSelectTitlestring
undefined
undefinedTitle for select passcode screen
passcodeSelectSubtitlestring
undefined
undefinedSubtitle for select passcode screen
passcodeSelectErrorTitlestring
undefined
undefinedTitle for select passcode screen when error
passcodeSelectErrorSubtitlestring
undefined
undefinedSubtitle for select passcode screen when error
passcodeConfirmTitlestring
undefined
undefinedTitle for confirm passcode screen
passcodeConfirmSubtitlestring
undefined
undefinedSubtitle for confirm passcode screen
passcodeConfirmErrorTitlestring
undefined
undefinedTitle for confirm passcode screen when error
passcodeConfirmErrorSubtitlestring
undefined
undefinedSubtitle for confirm passcode screen when error
passcodeInputTitlestring
undefined
undefinedTitle for input passcode screen
passcodeInputSubtitlestring
undefined
undefinedSubtitle for input passcode screen
passcodeInputErrorTitlestring
undefined
undefinedTitle for input passcode screen when error
passcodeInputErrorSubtitlestring
undefined
undefinedSubtitle for input passcode screen when error
lockedTitlestring
undefined
undefinedTitle for locked screen
lockedSubtitle(timer: number) => string
undefined
undefinedSubtitle with remain locked time for locked screen
  • Custom components
KeyTypeDefaultDescription
deleteButtonIconJSX.Element
undefined
undefinedSet icon for delete button keypad
biometryButtonIconJSX.Element
undefined
undefinedSet icon for biometry trigger keypad (bottom left button)
lockedButtonJSX.Element
undefined
undefinedLocked page button
lockedPageJSX.Element
undefined
undefinedCustom locked page
bottomLeftButtonJSX.Element
undefined
undefinedCustom bottom left button (biometry trigger button)
deleteButton(handler: () => void) => JSX.Element
undefined
undefinedCustom delete button keypad with handler method in module
keypadButton(index: number, handler: (buttonIndex: string) => void) => JSX.Element
undefined
undefinedCustom keypad button with handler and button index
  • Styles
KeyTypeDefaultDescription
styleLockedContainerStyleProp<ViewStyle>
undefined
undefinedStyle of locked screen's container
styleLockedTextContainerStyleProp<ViewStyle>
undefined
undefinedStyle of locked screen text container
styleLockedTitleStyleProp<TextStyle>
undefined
undefinedStyle of locked screen's container
styleLockedSubtitleStyleProp<TextStyle>
undefined
undefinedStyle of locked screen's container
styleLockedTimerContainerStyleProp<ViewStyle>
undefined
undefinedStyle of locked screen's timer container
styleLockedTimerTextStyleProp<TextStyle>
undefined
undefinedStyle of locked screen's timer text
styleLockedIconContainerStyleProp<ViewStyle>
undefined
undefinedStyle of locked screen's center icon container
stylePasscodeContainerStyleProp<ViewStyle>
undefined
undefinedStyle of passcode container
stylePasscodeTitleStyleProp<TextStyle>
undefined
undefinedStyle of passcode title
stylePasscodeSubtitleStyleProp<TextStyle>
undefined
undefinedStyle of passcode subtitle
stylePasscodeHiddenStyleProp<ViewStyle>
undefined
undefinedStyle of passcode indicator when hidden
stylePasscodeTextStyleProp<TextStyle>
undefined
undefinedStyle of passcode indicator when show text
styleKeypadAlphabetCharHighlightedStyleProp<TextStyle>
undefined
undefinedStyle of alphabet chars when keypad pressed
styleKeypadNumberCharHighlightedStyleProp<TextStyle>
undefined
undefinedStyle of numeric chars when keypad pressed
styleKeypadAlphabetCharNormalStyleProp<TextStyle>
undefined
undefinedStyle of alphabet chars when keypad normal
styleKeypadNumberCharNormalStyleProp<TextStyle>
undefined
undefinedStyle of numeric chars when keypad normal

Helper functions

async hasUserSetPasscode(serviceName?: string) => Promise<boolean>

Returns a promise contains if passcode had been set or not

async deleteUserPasscode(serviceName?: string) => Promise<void>

Delete keychain stored passcode if existed

async resetPasscodeInternalStates = (passcodeAttempsStorageName?: string, timePasscodeLockedStorageName?: string) => Promise<void>

Reset all app internal state (time countdown for lock screen, number of fail attempts)

FAQs

Package last updated on 13 May 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc