Search code examples
react-nativeexpocryptojs

Using SRP lib in a React Native project


I am attempting to use a javascript SRP library called thinbus-srp (https://github.com/simbo1905/thinbus-srp-npm) in an Expo (React Native) project. It's getting hung up on the random-strings library depending on the Node crypto library. Of course, just doing npm i crypto doesn't work, so I'm not sure what to do next. How do I tell a dependency to use a different dependency, i.e. CryptoJS?

Edit: I see there's a fork called react-native-thinbus-srp (https://github.com/eXhausted/react-native-thinbus-srp) that may have solved this problem, but how do I use it in my project since it's not on npm?


Solution

  • I ended up cloning the SRP library I wanted, plopping it into my main directory, editing the code necessary and using it locally. No npm involved.