mirror of
https://github.com/aljazceru/react-native-pubky.git
synced 2026-02-01 13:14:45 +01:00
1a1ffc1124efdd34d73c0d6f3baee5087ca5a6b3
Add local installation instructions to README.md. Update scripts in package.json.
react-native-pubky
React Native implementation of pubky
Installation
npm install react-native-pubky
Local Installation
- Clone & npm install:
git clone git clone git@github.com:pubky/react-native-pubky.git && cd react-native-pubky && npm i
- Delete the
rust/pubkydirectory to prevent a memory error (This step will be removed once pubky is public). - Yarn add it to your project:
yarn add path/to/react-native-pubky
Usage
import { auth } from 'react-native-pubky';
const authRes = await auth("pubkyAuthUrl", "secretKey");
if (authRes.isErr()) {
console.log(authRes.error.message);
return;
}
console.log(authRes.value);
Update Bindings
After making changes to any of the Rust files, the bindings will need to be updated. To do this, run the following command:
npm run update-bindings
Finally, ensure that PubkyModule.kt, Pubky.swift, Pubky.mm & src/index.tsx are updated accordingly based on the changes made to the Rust files.
License
MIT
Resources
Languages
Kotlin
38.3%
Swift
23%
C
12.7%
TypeScript
10.7%
JavaScript
9.5%
Other
5.8%