{"_id":"@bitwala/react-native-safetynet","_rev":"5-49c8265238716dd93aed19509777b37f","name":"@bitwala/react-native-safetynet","dist-tags":{"latest":"1.1.0"},"versions":{"0.0.1":{"name":"@bitwala/react-native-safetynet","version":"0.0.1","main":"dist/index.js","typings":"dist/index.d.ts","repository":{"type":"git","url":"https://github.com/bitwala/react-native-safetynet.git"},"license":"MIT","publishConfig":{"access":"public"},"engines":{"node":">=12"},"scripts":{"build":"tsc","prepare":"yarn build","prettier":"prettier --write '**/*.{js,jsx,ts,tsx,json,md}'"},"prettier":{"singleQuote":true},"lint-staged":{"*.{js,jsx,ts,tsx,json,md}":"prettier --write"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"devDependencies":{"@types/node":"14.14.20","husky":"4.3.7","lint-staged":"10.5.3","prettier":"2.2.1","typescript":"4.1.3"},"description":"Google SafetyNet Attestation implementation for React Native","licenseText":"MIT License\n\nCopyright (c) 2021 Bitwala\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@bitwala/react-native-safetynet@0.0.1","dist":{"shasum":"0b4ae9f859de3efe981c49349dd6848309dbd3bb","integrity":"sha512-i44XHLlzjSbk9iqOWZ/met1AkNYIFo0v8lrABaPvaJNa6qsosF3EDkhuuJt5QVJ0ckC0L/Ywe31740i2awtyTw==","tarball":"https://registry.npmjs.org/@bitwala/react-native-safetynet/-/react-native-safetynet-0.0.1.tgz","fileCount":10,"unpackedSize":2334,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/YWUCRA9TVsSAnZWagAAxQ0P/1t8wV3v10UHai8Ybgj4\ngIW4o9o55cbP8a/DOmFu8FxiMKd9dvkziCu2Lip/EbQqEXL9PgSwtfcj4pqe\n7lbt/YQMmaE22Je83xPeZc1Cgp5Y17skDFxCk++YllKrTp15UTpgkH/7eq8p\nZqcqpgdfmFY3GdzhKP0yJCnj5JFTKnwFFtKgBgY8lVA89kdygCQ9ccxA8CSK\nVNzb2OWYlSDr4Dzl0bj42CebRkZh85+jN5TRH8J2DkanDUdAyYvPpkSEGFG/\nXp1hYwY22UyLEqZTgf7ov4NTD453TPVRP4ZODRNQtZt8FQQnUzSymTBC67Rx\nl/P+nWLAaparXhbcSj1CO+iKdJRJmaUnAFBoBCNltmYpaQgI6Je9w1KrYW4t\n6d96fl0sqUhBxgVU9Z0oGGtUmzlT9YmRxOHqJj3N+2lQgFt0vHyPImjnaX3q\nts7gNbXcgQLQ+A2aZoC+JqMq2KgkEGSfuLLq8UowUDR0Xhk6VAxaheuRZP8y\n+l5FuTt15XWbYuiuu2ITT3FsICAmxH2xKEKnWR5FOyifWzp599386hmdeR26\niyKJYVmVz4YMw0X6Ajeue2dl7hBJlm+teXO8pL/4niwlhZt32VKHbSwUCurB\nT2NCsLArxd9S1QDhqjI2VZd26/ESvm38AJuj4hiEvxZV6e8x4AY9cE0MmfXw\n3DQ4\r\n=toYY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBSyUGEYsPs/fPPyBeoTGFlPsZupuRhRVLkguqjEthZ2AiBqxVbVhYdpJAxtAhh88FBVD5Ji7gf1Z/tPfwS0TToi5Q=="}]},"_npmUser":{"name":"leopradel","email":"pradel.leo@gmail.com"},"directories":{},"maintainers":[{"name":"yogiben","email":"ben@meteorfactory.io"},{"name":"leopradel","email":"pradel.leo@gmail.com"},{"name":"emilio-bitwala","email":"emilio@bitwala.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-safetynet_0.0.1_1610450324211_0.19975044619073534"},"_hasShrinkwrap":false},"1.0.1":{"name":"@bitwala/react-native-safetynet","version":"1.0.1","main":"dist/index.js","typings":"dist/index.d.ts","repository":{"type":"git","url":"https://github.com/bitwala/react-native-safetynet.git"},"license":"MIT","publishConfig":{"access":"public"},"engines":{"node":">=12"},"scripts":{"build":"tsc","prepublishOnly":"yarn build","prettier":"prettier --write '**/*.{js,jsx,ts,tsx,json,md}'"},"keywords":["react-native","safetynet","android device verification","safetynet attestation","recaptcha","safetynet recaptcha","captcha verification"],"prettier":{"singleQuote":true},"lint-staged":{"*.{js,jsx,ts,tsx,json,md}":"prettier --write"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"peerDependencies":{"react-native":"^0.57.0"},"dependencies":{"node-fetch":"2.6.1"},"devDependencies":{"@types/node":"14.14.20","@types/node-fetch":"2.5.7","@types/react-native":"0.63.45","husky":"4.3.7","lint-staged":"10.5.3","prettier":"2.2.1","typescript":"4.1.3"},"description":"## About SafetyNet","licenseText":"MIT License\n\nCopyright (c) 2021 Bitwala\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@bitwala/react-native-safetynet@1.0.1","dist":{"shasum":"e2f27b2d272ea9e0dbdaf3977d7c858cd35eb3a4","integrity":"sha512-+k9EpkWKmsTsVsmaHKa1QVsGT5aW/BIk4pCP+MAH9AH0HfF2c/RoTRQaDHGxhXzHETE7jXhx5G6fKF0kTmhOdg==","tarball":"https://registry.npmjs.org/@bitwala/react-native-safetynet/-/react-native-safetynet-1.0.1.tgz","fileCount":11,"unpackedSize":15114,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/ZCxCRA9TVsSAnZWagAA0QMP/3eIn1bZgCOAi4lS9/RP\n36oaackTjyZTocDGkprddw2jf2TdqvxCjhjYUana4Msy+IgCyJlJw5MzTqNm\n/4Xg8QfIkarejJlCybSdCUU5+1a5pi59i5VL+DREFl4/gey+PJR/bCipP26m\n3O78rm2vaZiuYLbEQvuKkH3/fYCkJbYMsqtsG85n31/4z7wIMGYRjZ1u0jFp\nb8Qk6msMQFGLKp9ECWt+S1c6ZNKNTSVzbFrbCEKQULluNnUFYiUbwq7duP1D\nZSWSn0gd3aFgKgFwgphE+AM22Pvt2EAoIfXi1LP766uvPyhQyBM48LPy5A4Y\nzpMjZUBigOHqZJrtyiOgUmbLBYQRjSFx04bAGHmifSWDEfwgStE8lhZVlXYl\nEohsIjXoMHjPDjRTTTevFwqsBvsirw6q+L1fju0G8L//4Xcm8KSesTHCN1Cg\nWBjcMr/7AEvNXxumHob4pRxAAVVZ24LRHE4Sku4mCEPlTkFHyWM+D9xXdh+v\ncNAvjXiuqcak8vG5sj6of5UuejcABuCXl9wYQJhpoV/M4weddwPaBYBbuohJ\nx4q0EJvYlinXbHvBnjRe0WheXA1qF5s1GqsjpRLzh1y0Smvof8vciMg7NhVd\nXUCKOtA84qsN1Z55zYp+aTAVWFLexxRRg9S6+Faalf8iQRw9QEHwwU2cT6mi\nZd6W\r\n=VY5T\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCXBFfyegOADL79LUe6rw16QDexSu5BEJg7zlQ+CoZg5AIgLU4vKSaNN+Yuqko7aBIoIVUQjEpBcliuiidT2k1/q7o="}]},"_npmUser":{"name":"leopradel","email":"pradel.leo@gmail.com"},"directories":{},"maintainers":[{"name":"yogiben","email":"ben@meteorfactory.io"},{"name":"leopradel","email":"pradel.leo@gmail.com"},{"name":"emilio-bitwala","email":"emilio@bitwala.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-safetynet_1.0.1_1610453169084_0.5176862880800934"},"_hasShrinkwrap":false},"1.1.0":{"name":"@bitwala/react-native-safetynet","version":"1.1.0","main":"dist/index.js","typings":"dist/index.d.ts","repository":{"type":"git","url":"https://github.com/bitwala/react-native-safetynet.git"},"license":"MIT","publishConfig":{"access":"public"},"engines":{"node":">=12"},"scripts":{"build":"tsc","prepublishOnly":"yarn build","prettier":"prettier --write '**/*.{js,jsx,ts,tsx,json,md}'"},"keywords":["react-native","safetynet","android device verification","safetynet attestation","recaptcha","safetynet recaptcha","captcha verification"],"prettier":{"singleQuote":true},"lint-staged":{"*.{js,jsx,ts,tsx,json,md}":"prettier --write"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"peerDependencies":{"react-native":"^0.57.0"},"dependencies":{"node-fetch":"2.6.1"},"devDependencies":{"@types/node":"14.14.20","@types/node-fetch":"2.5.7","@types/react-native":"0.63.45","husky":"4.3.7","lint-staged":"10.5.3","prettier":"2.2.1","typescript":"4.1.3"},"description":"## About SafetyNet","licenseText":"MIT License\n\nCopyright (c) 2021 Bitwala\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@bitwala/react-native-safetynet@1.1.0","dist":{"shasum":"0cdfd4dc4cf819d34e478a5e0ca90f3b7db680f8","integrity":"sha512-59XYRLQLhmSzKSOiJ9Ym7Rsm5kAFreoqUPmWSQh0Ai9G7QEkh3xEq04X2dhHQZP4l12RmT92uASR/AlvxdDPPA==","tarball":"https://registry.npmjs.org/@bitwala/react-native-safetynet/-/react-native-safetynet-1.1.0.tgz","fileCount":28,"unpackedSize":84501,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2BiNCRA9TVsSAnZWagAAr5AP/3m/aMLVFAhxZ7kbAjKI\nJWkmmCFI8b8iAFlbRIvu44QNWnpu4kCpXGI+KRPCRcZfUfPDyPzfwV+c6200\npaCI1jkJDA3wDhirKwD5ve11aP5YzmXppAJY80U0G1tkHIDSHNTNnAvZ6eSx\nzDo4A/C3+EVR3CWyjhbKQO82RoWRL1pW73aV+qVDdiy5wp4h8+ZkUIX5mxoV\nZpYZ2AaeAJnsIxnECh7xHKBLDps20SETLB867oRBrwcACh2fByqPWpxo9+3D\nMesQb3YcC/XBTVyAQEyq3ljA0Te9ZzvoKwZ9vEt1kEsEz4hyMwoB8PLZzCNt\nX1PzGVyEGMv9sga9pWUOaKxtcyGmQAb9KuZ4Jo1D3tTsUqyQRp344JjJW9XC\npcKbmeLNdsROGMCe00tmwKs24naeQ6yV23pQwWSfbOJdGw09ASqjt0+vLxYb\no0SFv6OzR2xP/BprJ5E+ZZvO6lnmu6AAtkfeidmWpDcmsgnoJjZI+JKERkyH\nXt0UktlljTrtogn6ZiTG0Ee5BdIrpyWOUjZTkBd8ZnlZq6a/LOaHKnrI4VRB\nu12SHcnFXW2wzB1u/XJNrbKLL1K72XtsxLLA+1FHigHUoqtp4HOT9id9cbRo\nsygQDXEj6nAzy2HAnOqqnuWjU2qA7uphMJHQd8WuwttyKcljhVnPzeiagalR\neeXs\r\n=jVQo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIQDyJAq4AKddalCTXXLXf/yfJJR+GWJMVfCXxeY8SwBHEQIfBnkkxZGQp+2lVKzvF5YCpEWkH2QCOF8koryYBS2HfQ=="}]},"_npmUser":{"name":"leopradel","email":"pradel.leo@gmail.com"},"directories":{},"maintainers":[{"name":"yogiben","email":"ben@meteorfactory.io"},{"name":"leopradel","email":"pradel.leo@gmail.com"},{"name":"emilio-bitwala","email":"emilio@bitwala.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-safetynet_1.1.0_1610454981645_0.32301279484223144"},"_hasShrinkwrap":false}},"time":{"created":"2021-01-12T11:18:44.026Z","0.0.1":"2021-01-12T11:18:44.352Z","modified":"2022-04-04T19:14:41.344Z","1.0.1":"2021-01-12T12:06:09.234Z","1.1.0":"2021-01-12T12:36:21.805Z"},"maintainers":[{"email":"dehnavi@gmx.com","name":"emilvr"},{"email":"ben@meteorfactory.io","name":"yogiben"},{"email":"pradel.leo@gmail.com","name":"leopradel"},{"email":"emilio@bitwala.com","name":"emilio-bitwala"}],"description":"## About SafetyNet","repository":{"type":"git","url":"https://github.com/bitwala/react-native-safetynet.git"},"license":"MIT","readme":"# Google SafetyNet Attestation for React Native\n\n## About SafetyNet\n\nGoogle provides an API to verify device integrity and detect harmful apps. See the [SafetyNet documentation](https://developer.android.com/training/safetynet/index.html) for more information.\n\n## Getting Started\n\n`$ npm install @bitwala/react-native-safetynet`\n\nor\n\n`$ yarn add @bitwala/react-native-safetynet`\n\n### Mostly Automatic Installation\n\n`$ react-native link @bitwala/react-native-safetynet`\n\n### Manual installation\n\n#### Android\n\n1. Open up `android/app/src/main/java/[...]/MainActivity.java`\n\n- Add `import com.bitwala.safetynet.RNSafetyNetPackage;` to the imports at the top of the file\n- Add `new RNSafetyNetPackage()` to the list returned by the `getPackages()` method\n\n2. Append the following lines to `android/settings.gradle`:\n   ```\n   include ':@bitwala/react-native-safetynet'\n   project(':@bitwala/react-native-safetynet').projectDir = new File(rootProject.projectDir, \t'../node_modules/@bitwala/react-native-safetynet/android')\n   ```\n3. Insert the following lines inside the dependencies block in `android/app/build.gradle`:\n   ```\n     implementation project(':@bitwala/react-native-safetynet')\n   ```\n\n## Usage\n\n```javascript\nimport RNSafetyNetClient from '@bitwala/react-native-safetynet';\n\n// STEP 1: Send nonce request to server with device unique id\nconst deviceId =\n  'You can use the \"react-native-device-info\" module to get the unique id of device';\n\nconst nonceResult = await RNSafetyNetClient.requestNonce({\n  endPointUrl: 'https://your-server/nonce-creator-endpoint',\n  additionalData: deviceId,\n});\n\nif (!nonceResult.nonce || nonceResult.error) {\n  console.log(nonceResult.error);\n  return;\n}\n\n// STEP 2: Send attestation request to Google Play\n\nconst attestationResult = await RNSafetyNetClient.sendAttestationRequest(\n  nonceResult.nonce,\n  'YOUR API KEY'\n);\n\nif (!attestationResult.jws || attestationResult.error) {\n  console.log('Attestation request failed.');\n  return;\n}\n\n// STEP 3: Pass the JSW to your server for verification.\n\nconst verification = await RNSafetyNetClient.verifyAttestationResult({\n  endPointUrl: 'https://your-server/verification-endpoint',\n  attestationJws: attestationResult.jws,\n});\n```\n","readmeFilename":"README.md","keywords":["react-native","safetynet","android device verification","safetynet attestation","recaptcha","safetynet recaptcha","captcha verification"]}