coreyphillips 43a62ca14b fix: fix auth
Updates auth implementation.
2024-09-16 23:03:30 -04:00
2024-09-16 23:03:30 -04:00
2024-09-16 23:03:30 -04:00
2024-09-16 23:03:30 -04:00
2024-09-16 23:03:30 -04:00
2024-09-15 21:17:10 -04:00
2024-09-11 22:03:27 -04:00
2024-09-15 12:35:12 -04:00
2024-09-11 22:03:27 -04:00
2024-09-11 22:03:27 -04:00
2024-09-11 22:03:27 -04:00
2024-09-15 12:38:04 -04:00
2024-09-16 23:03:30 -04:00
2024-09-15 21:17:10 -04:00
2024-09-15 12:35:12 -04:00
2024-09-11 22:03:27 -04:00
2024-09-15 12:35:12 -04:00
2024-09-11 22:03:27 -04:00
2024-09-15 12:35:12 -04:00

react-native-pubky

React Native implementation of pubky

Installation

npm install @synonymdev/react-native-pubky

Implementation Status

Implemented Methods

  • auth: Authentication functionality.
  • parseAuthUrl: Method to decode an authUrl.

Methods to be Implemented

  • publish: Functionality to publish content.
  • resolve: Functionality to resolve content.
  • signIn: Functionality to sign in.
  • signUp: Functionality to sign up.

Usage

Auth

import { auth } from '@synonymdev/react-native-pubky';

const authRes = await auth("pubkyAuthUrl", "secretKey");
if (authRes.isErr()) {
  console.log(authRes.error.message);
  return;
}
console.log(authRes.value);

parseAuthUrl

import { parseAuthUrl } from '@synonymdev/react-native-pubky';

const pubkyAuthUrl = 'pubkyauth:///?relay=https://demo.httprelay.io/link&capabilities=/pub/pubky.app:rw,/pub/example.com/nested:rw&secret=FyzJ3gJ1W7boyFZC1Do9fYrRmDNgCLNRwEu_gaBgPUA';
const parseRes = await parseAuthUrl(pubkyAuthUrl);
if (parseRes.isErr()) {
  console.log(parseRes.error.message);
  return;
}
console.log(parseRes.value);

Local Installation

  1. Clone & npm install:
git clone git@github.com:pubky/react-native-pubky.git && cd react-native-pubky && npm i
  1. Delete the rust/pubky directory to prevent a memory error (This step will be removed once pubky is public).
  2. Yarn add it to your project:
yarn add path/to/react-native-pubky

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

Description
No description provided
Readme MIT 451 MiB
Languages
Kotlin 38.3%
Swift 23%
C 12.7%
TypeScript 10.7%
JavaScript 9.5%
Other 5.8%