{"_id":"@carlossts/rtn-local-authentication","_rev":"7-ccdd0d67ebe3451c5cba5c7ccbe374f8","name":"@carlossts/rtn-local-authentication","dist-tags":{"latest":"1.0.4"},"versions":{"1.0.1":{"name":"@carlossts/rtn-local-authentication","version":"1.0.1","keywords":["react-native","android"],"license":"MIT","_id":"@carlossts/rtn-local-authentication@1.0.1","maintainers":[{"name":"carlossts","email":"carlossts826@gmail.com"}],"homepage":"https://github.com/CarlosSTS/rtn-local-authentication#readme","bugs":{"url":"https://github.com/CarlosSTS/rtn-local-authentication/issues"},"dist":{"shasum":"9d1db6458c92cd1c047f2dd94c7fca60cf90596d","tarball":"https://registry.npmjs.org/@carlossts/rtn-local-authentication/-/rtn-local-authentication-1.0.1.tgz","fileCount":8,"integrity":"sha512-9sIzgYQsYpvMD4IPEfJQoDOnd/8yQJ+uu7uVytnwvyiUeNby6Q/gJqJU8+lqTC53ISeCNzbsp1JeaPpUkca6NQ==","signatures":[{"sig":"MEQCIDyiMGUckjucVaLkLCdiO5QnZGy5wvww6P0f6N/bWCwVAiAcnD8Cphe+7cGB/e2q2Nh3i4WSl1BhEguTHuasLtT5uA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":12369},"main":"js/index.ts","source":"js/index","gitHead":"2fd2018f428a5ba59b0746f0688662890f21ab5d","_npmUser":{"name":"carlossts","email":"carlossts826@gmail.com"},"repository":{"url":"git+https://github.com/CarlosSTS/rtn-local-authentication.git","type":"git"},"_npmVersion":"10.7.0","description":"Local authentication with Turbo Modules","directories":{},"_nodeVersion":"20.14.0","react-native":"js/index","codegenConfig":{"name":"RTNLocalAuthenticationSpec","type":"modules","android":{"javaPackageName":"com.rtnlocalauthentication"},"jsSrcsDir":"js"},"_hasShrinkwrap":false,"devDependencies":{},"peerDependencies":{"react":"*","react-native":"*"},"_npmOperationalInternal":{"tmp":"tmp/rtn-local-authentication_1.0.1_1728132914363_0.3311262023909882","host":"s3://npm-registry-packages"}},"1.0.2":{"name":"@carlossts/rtn-local-authentication","version":"1.0.2","keywords":["react-native","android"],"license":"MIT","_id":"@carlossts/rtn-local-authentication@1.0.2","maintainers":[{"name":"carlossts","email":"carlossts826@gmail.com"}],"homepage":"https://github.com/CarlosSTS/rtn-local-authentication#readme","bugs":{"url":"https://github.com/CarlosSTS/rtn-local-authentication/issues"},"dist":{"shasum":"6f1c915c439ba70023a6a13ed1b8b2f08bef4232","tarball":"https://registry.npmjs.org/@carlossts/rtn-local-authentication/-/rtn-local-authentication-1.0.2.tgz","fileCount":8,"integrity":"sha512-ReS4RaRLUGw1XLP2JBt/sYXS9XGIKYdpfQfiMApSSFmf+7LkN2FFFSV3aTQnhOYd5f5jzNR5D7PeHZw42/bEsg==","signatures":[{"sig":"MEYCIQD8jaD1E2gqniFFY9zsJfIsHmwjm/z4UeVG76PK5we7rgIhAKxX+Cbvk5Q84ijecRNsatkCT0nvHn9ifN0ZACkcIbN8","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":12373},"main":"js/index.ts","source":"js/index","gitHead":"bbd67664a1e4b4df245ef1370c82a00875b1dada","_npmUser":{"name":"carlossts","email":"carlossts826@gmail.com"},"repository":{"url":"git+https://github.com/CarlosSTS/rtn-local-authentication.git","type":"git"},"_npmVersion":"10.7.0","description":"Local authentication with Turbo Modules","directories":{},"_nodeVersion":"20.14.0","react-native":"js/index","codegenConfig":{"name":"RTNLocalAuthenticationSpec","type":"modules","android":{"javaPackageName":"com.rtnlocalauthentication"},"jsSrcsDir":"js"},"_hasShrinkwrap":false,"devDependencies":{},"peerDependencies":{"react":"*","react-native":"*"},"_npmOperationalInternal":{"tmp":"tmp/rtn-local-authentication_1.0.2_1728134771332_0.0034244117205066704","host":"s3://npm-registry-packages"}},"1.0.3":{"name":"@carlossts/rtn-local-authentication","version":"1.0.3","keywords":["react-native","android"],"license":"MIT","_id":"@carlossts/rtn-local-authentication@1.0.3","maintainers":[{"name":"carlossts","email":"carlossts826@gmail.com"}],"homepage":"https://github.com/CarlosSTS/rtn-local-authentication#readme","bugs":{"url":"https://github.com/CarlosSTS/rtn-local-authentication/issues"},"dist":{"shasum":"f255a727e15968844713268d23925cf2568b50fb","tarball":"https://registry.npmjs.org/@carlossts/rtn-local-authentication/-/rtn-local-authentication-1.0.3.tgz","fileCount":8,"integrity":"sha512-lFNYVxwJoCo5c+RPxq0fEq3u9/o3gVpSfyqSbHy/+VVFSxHEDUU12XDZe3D87HI2rpdhWFNyzmlleLODjyLZEw==","signatures":[{"sig":"MEQCIH8jCvTl2/D34jlkX2jsgtnZTQ3ZyXpwc4+I66qSo+THAiBoCaciTG5PZ2cB4rQwI5T99pxWIgKKzVE1xp/onZw6CQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":12395},"main":"js/index.ts","source":"js/index","gitHead":"94cd0c54f74dcfd96fcb4828c173072787d0b197","_npmUser":{"name":"carlossts","email":"carlossts826@gmail.com"},"repository":{"url":"git+https://github.com/CarlosSTS/rtn-local-authentication.git","type":"git"},"_npmVersion":"10.7.0","description":"Local authentication with Turbo Modules","directories":{},"_nodeVersion":"20.14.0","react-native":"js/index","codegenConfig":{"name":"RTNLocalAuthenticationSpec","type":"modules","android":{"javaPackageName":"com.rtnlocalauthentication"},"jsSrcsDir":"js"},"_hasShrinkwrap":false,"devDependencies":{},"peerDependencies":{"react":"*","react-native":"*"},"_npmOperationalInternal":{"tmp":"tmp/rtn-local-authentication_1.0.3_1728137917659_0.511248269317252","host":"s3://npm-registry-packages"}},"1.0.4":{"name":"@carlossts/rtn-local-authentication","version":"1.0.4","description":"Local authentication with Turbo Modules","repository":{"type":"git","url":"git+https://github.com/CarlosSTS/rtn-local-authentication.git"},"bugs":{"url":"https://github.com/CarlosSTS/rtn-local-authentication/issues"},"homepage":"https://github.com/CarlosSTS/rtn-local-authentication#readme","main":"js/index.ts","react-native":"js/index","source":"js/index","keywords":["react-native","android"],"license":"MIT","devDependencies":{},"peerDependencies":{"react":"*","react-native":"*"},"codegenConfig":{"name":"RTNLocalAuthenticationSpec","type":"modules","jsSrcsDir":"js","android":{"javaPackageName":"com.rtnlocalauthentication"}},"_id":"@carlossts/rtn-local-authentication@1.0.4","gitHead":"1bc9580a9c192d4a0fb78a323bb70ca262a8927e","_nodeVersion":"22.22.2","_npmVersion":"10.9.7","dist":{"integrity":"sha512-S8l8LJOh8uTGrd56MtpB6FGIZAWCbA+K+b8Pe8oO5b6oD5hc+6CorSuCoRpUCx9R5TsPr6DHvIPI6Ix1FhWzZQ==","shasum":"f15634f5095411fc674f1e1494b95be3acf4381f","tarball":"https://registry.npmjs.org/@carlossts/rtn-local-authentication/-/rtn-local-authentication-1.0.4.tgz","fileCount":8,"unpackedSize":11949,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDJdWe8jRfkJmR1Uj5vKidSgYSslM4Mdc8UBQI2o+SuogIhAKMOrYO3TTXbtC6QMyyLSdsx77DrQrbVE6PYwu1dcqb2"}]},"_npmUser":{"name":"carlossts","email":"carlossts826@gmail.com"},"directories":{},"maintainers":[{"name":"carlossts","email":"carlossts826@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/rtn-local-authentication_1.0.4_1776390277919_0.4805368121308746"},"_hasShrinkwrap":false}},"time":{"created":"2024-10-05T12:55:14.263Z","modified":"2026-04-17T01:44:38.192Z","1.0.0":"2024-10-05T12:36:19.949Z","1.0.1":"2024-10-05T12:55:14.538Z","1.0.2":"2024-10-05T13:26:11.520Z","1.0.3":"2024-10-05T14:18:37.928Z","1.0.4":"2026-04-17T01:44:38.082Z"},"bugs":{"url":"https://github.com/CarlosSTS/rtn-local-authentication/issues"},"license":"MIT","homepage":"https://github.com/CarlosSTS/rtn-local-authentication#readme","keywords":["react-native","android"],"repository":{"type":"git","url":"git+https://github.com/CarlosSTS/rtn-local-authentication.git"},"description":"Local authentication with Turbo Modules","maintainers":[{"name":"carlossts","email":"carlossts826@gmail.com"}],"readme":"# `rtn-local-authentication`\n\n`rtn-local-authentication` is a local authentication library for React Native, built using Turbo Modules. It provides an interface for biometric and PIN authentication on Android devices.\n\n## Features\n\n- Support for fingerprint, PIN, and pattern authentication on Android.\n- Fully compatible with React Native's Turbo Module system.\n- Simple API to integrate local authentication into your React Native application.\n\n## Installation\n\n### Prerequisites\n\nEnsure your React Native project is properly configured to use Turbo Modules. For more details, follow the official [React Native Turbo Modules documentation](https://reactnative.dev/docs/the-new-architecture/landing-page).\n\n> If your version of react-native does not support turbo-modules, I recommend https://github.com/tradle/react-native-local-auth\n\n### Install the package\n\n```bash\nnpm install @carlossts/rtn-local-authentication\nor\nyarn add @carlossts/rtn-local-authentication\n```\n\n## UI\n\n### authenticate method\n\n<table>\n  <tr>\n<td><img src=\"https://res.cloudinary.com/dbw8igay3/image/upload/v1767028349/image01_hia3w7.png\" alt=\"fingerprintOrPin\" width=\"360\" /></td>\n<td><img src=\"https://res.cloudinary.com/dbw8igay3/image/upload/v1767028347/image02_pqry7x.png\" alt=\"PIN\" width=\"360\" /></td>\n<td><img src=\"https://res.cloudinary.com/dbw8igay3/image/upload/v1767028345/image03_yraxmp.png\" alt=\"pattern\" width=\"360\" /></td>\n</tr>\n</table>\n\n### isDeviceSecure method\n\n<table>\n  <tr>\n<td><img src=\"https://res.cloudinary.com/dbw8igay3/image/upload/v1767028344/image04_shvpgp.png\" alt=\"isDeviceSecure\" width=\"360\" /></td>\n</tr>\n</table>\n\n## API Reference\n\n## Methods\n\n### `authenticate(map: { reason?: string; description?: string }): Promise<string>()`\n\nLocal device authentication process (using password, PIN, pattern or fingerprint), verifying that the device is protected by some security method, such as a password or biometrics.\n\nObservation: If the device does not have local authentication, return success with the code WITHOUT_AUTHENTICATION.\n\n## Options\n\n| Option                | Description                                       |\n| --------------------- | ------------------------------------------------- |\n| reason                | Action title                                      |\n| description           | Action description                                |\n\n\n## Usage\n\n```js\nimport React, { useCallback, useEffect } from 'react';\nimport { Alert, View } from 'react-native';\nimport {RNTLocalAuthentication} from '@carlossts/rtn-local-authentication';\n\nconst App = () => {\n  const authenticationLocal = useCallback(async () => {\n    try {\n      await RNTLocalAuthentication?.authenticate({\n        reason: 'Please authenticate yourself',\n        description: 'Enter your password or fingerprint',\n      });\n    } catch (error) {\n      Alert.alert('Authentication Failed', error.message);\n    }\n  }, []);\n\n  useEffect(() => {\n    authenticationLocal();\n  }, [authenticationLocal]);\n\n  return <View />;\n};\n\nexport default App;\n```\n\n## ErrorCode\n\n| Code                  | Description                                       |\n| --------------------- | ------------------------------------------------- |\n| E_AUTH_CANCELLED      | User canceled the authentication                  |\n| E_ONE_REQ_AT_A_TIME   | Authentication already in progress                |\n| E_FAILED_TO_SHOW_AUTH | Failed to create authentication intent            |\n\n##\n\n### `isDeviceSecure(): Promise<boolean>`\n\nChecks if the device has some type of authentication.\n\n## Usage\n\n```js\nimport React, { useCallback, useEffect } from 'react';\nimport { Alert, View } from 'react-native';\nimport {RNTLocalAuthentication} from '@carlossts/rtn-local-authentication';\n\nconst App = () => {\n  const isDeviceSecure = useCallback(async () => {\n    try {\n     const result = await RNTLocalAuthentication?.isDeviceSecure();\n    Alert.alert('Is it a secure device ?', result ? 'Yes' : 'No');\n    } catch (error) {\n      Alert.alert('isDeviceSecure Failed', error.message);\n    }\n  }, []);\n\n  useEffect(() => {\n    isDeviceSecure();\n  }, [isDeviceSecure]);\n\n  return <View />;\n};\n\nexport default App;\n```\n\n## License\n\n[MIT](LICENSE.md)\n\n","readmeFilename":"README.md"}