npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@synonymdev/react-native-pubky

v0.14.0

Published

React Native Implementation of Pubky

Readme

react-native-pubky

React Native implementation of pubky-core

Installation

npm install @synonymdev/react-native-pubky

Implementation Status

Implemented Methods

  • [x] auth: Authentication functionality.
  • [x] parseAuthUrl: Method to decode an authUrl.
  • [x] publish: Functionality to publish content.
  • [x] resolve: Functionality to resolve content.
  • [x] publishHttps: Publish HTTPS records.
  • [x] resolveHttps: Resolve HTTPS records.
  • [x] getSignupToken: Get a signup token from a homeserver with admin credentials.
  • [x] signUp: Grant sign-up to a homeserver and update Pkarr accordingly, with optional signup token support.
  • [x] signUpGrant / signUpCookie: Explicit Grant and legacy cookie sign-up methods.
  • [x] republishHomeserver: Republish homeserver information to the DHT.
  • [x] signIn: Grant sign-in to a homeserver.
  • [x] signInGrant / signInCookie: Explicit Grant and legacy cookie sign-in methods.
  • [x] signOut: Sign-out from a homeserver.
  • [x] put: Upload a small payload to a given path.
  • [x] get: Download a small payload from a given path relative to a pubky author.
  • [x] list: Returns a list of Pubky URLs of the files in the path of the url provided.
  • [x] delete: Delete a file at a path relative to a pubky author.
  • [x] generateSecretKey: Generate a secret key.
  • [x] getPublicKeyFromSecretKey: Get the public key string and uri from a secret key.
  • [x] create_recovery_file: Create a recovery file.
  • [x] decrypt_recovery_file: Decrypt a recovery file.
  • [x] getHomeserver: Get homeserver URL from a public key.
  • [x] startAuthFlow: Start a Grant authentication flow with requested capabilities.
  • [x] awaitAuthApproval: Await approval of a pending Grant auth flow.
  • [x] startGrantAuthFlow / startCookieAuthFlow: Explicit Grant and legacy cookie auth-flow methods.
  • [x] awaitGrantAuthApproval / awaitCookieAuthApproval: Await explicit Grant and legacy cookie auth flows.
  • [x] putWithSession: Upload content to a path using session-based authentication.
  • [x] deleteWithSession: Delete content at a path using session-based authentication.

Usage

signUp, signIn, startAuthFlow, and awaitAuthApproval are Grant-auth aliases. Use the explicit *Grant names when the distinction matters. Legacy cookie auth is still exposed through the explicit *Cookie methods because the native binding mirrors upstream pubky, but cookie auth is deprecated upstream.

Auth

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

const authRes = await auth(
  'pubkyauth:///?caps=/pub/pubky.app/:rw,/pub/foo.bar/file:r&secret=U55XnoH6vsMCpx1pxHtt8fReVg4Brvu9C0gUBuw-Jkw&relay=http://167.86.102.121:4173/',
  'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'
);
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);

publish

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

const publishRes = await publish(
  'recordnametest',
  'recordcontenttest',
  'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'
);
if (publishRes.isErr()) {
  console.log(publishRes.error.message);
  return;
}
console.log(publishRes.value);

resolve

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

const resolveRes = await resolve(
  'z4e8s17cou9qmuwen8p1556jzhf1wktmzo6ijsfnri9c4hnrdfty'
);
if (resolveRes.isErr()) {
  console.log(resolveRes.error.message);
  return;
}
console.log(resolveRes.value);

publishHttps

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

const publishHttpsRes = await publishHttps(
  'example.com', // Record Name
  'target.example.com', // Target
  'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855' // Secret Key
);
if (publishHttpsRes.isErr()) {
  console.log(publishHttpsRes.error.message);
  return;
}
console.log(publishHttpsRes.value);

resolveHttps

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

const resolveHttpsRes = await resolveHttps(
  'z4e8s17cou9qmuwen8p1556jzhf1wktmzo6ijsfnri9c4hnrdfty' // Public key
);
if (resolveHttpsRes.isErr()) {
  console.log(resolveHttpsRes.error.message);
  return;
}
console.log(resolveHttpsRes.value);

put

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

const putRes = await put(
  'pubky://z4e8s17cou9qmuwen8p1556jzhf1wktmzo6ijsfnri9c4hnrdfty/pub/synonym.to', // URL
  { data: 'test content' }, // Content
  'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855', // Secret Key
  'my-app.example' // Client ID
);
if (putRes.isErr()) {
  console.log(putRes.error.message);
  return;
}
console.log(putRes.value);

get

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

const getRes = await get(
  'pubky://z4e8s17cou9qmuwen8p1556jzhf1wktmzo6ijsfnri9c4hnrdfty/pub/synonym.to' // URL
);
if (getRes.isErr()) {
  console.log(getRes.error.message);
  return;
}
console.log(getRes.value);

list

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

const listRes = await list(
  'pubky://z4e8s17cou9qmuwen8p1556jzhf1wktmzo6ijsfnri9c4hnrdfty/pub/' // URL
);
if (listRes.isErr()) {
  console.log(listRes.error.message);
  return;
}
console.log(listRes.value);

deleteFile

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

const deleteFileRes = await deleteFile(
  'pubky://z4e8s17cou9qmuwen8p1556jzhf1wktmzo6ijsfnri9c4hnrdfty/pub/', // URL
  'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855', // Secret Key
  'my-app.example' // Client ID
);
if (deleteFileRes.isErr()) {
  console.log(deleteFileRes.error.message);
  return;
}
console.log(deleteFileRes.value);

generateSecretKey

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

const generateSecretKeyRes = await generateSecretKey();
if (generateSecretKeyRes.isErr()) {
  console.log(generateSecretKeyRes.error.message);
  return;
}
console.log(generateSecretKeyRes.value);

getPublicKeyFromSecretKey

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

const getPublicKeyFromSecretKeyRes = await getPublicKeyFromSecretKey('e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855');
if (getPublicKeyFromSecretKeyRes.isErr()) {
  console.log(getPublicKeyFromSecretKeyRes.error.message);
  return;
}
console.log(getPublicKeyFromSecretKeyRes.value);

getSignupToken

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

const getSignupTokenRes = await getSignupToken(
  '8pinxxgqs41n4aididenw5apqp1urfmzdztr8jt4abrkdn435ewo', // Homeserver pubky
  'admin_password' // Admin Password
);
if (getSignupTokenRes.isErr()) {
  console.log(getSignupTokenRes.error.message);
  return;
}
console.log('Signup Token:', getSignupTokenRes.value);

signUp

import { signUp, signUpCookie } from '@synonymdev/react-native-pubky';

// Standard signup
const signUpRes = await signUp(
  'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855', // Secret
  'pubky://8pinxxgqs41n4aididenw5apqp1urfmzdztr8jt4abrkdn435ewo', // Homeserver
  undefined, // Optional signup token
  'my-app.example' // Client ID
);
if (signUpRes.isErr()) {
  console.log(signUpRes.error.message);
  return;
}
console.log(signUpRes.value);

// Signup with token
const signUpWithTokenRes = await signUp(
  'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855', // Secret
  'pubky://8pinxxgqs41n4aididenw5apqp1urfmzdztr8jt4abrkdn435ewo', // Homeserver
  'your_signup_token', // Optional signup token
  'my-app.example' // Client ID
);
if (signUpWithTokenRes.isErr()) {
  console.log(signUpWithTokenRes.error.message);
  return;
}
console.log(signUpWithTokenRes.value);

const cookieSignUpRes = await signUpCookie(
  'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855', // Secret
  'pubky://8pinxxgqs41n4aididenw5apqp1urfmzdztr8jt4abrkdn435ewo', // Homeserver
  undefined // Optional signup token
);
if (cookieSignUpRes.isErr()) {
  console.log(cookieSignUpRes.error.message);
  return;
}
console.log(cookieSignUpRes.value); // { pubky, capabilities, session_secret }

republishHomeserver

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

const republishRes = await republishHomeserver(
  'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855', // Secret Key
  'pubky://8pinxxgqs41n4aididenw5apqp1urfmzdztr8jt4abrkdn435ewo' // Homeserver
);
if (republishRes.isErr()) {
  console.log(republishRes.error.message);
  return;
}
console.log(republishRes.value); // "Homeserver republished successfully"

signIn

import { signIn, signInCookie } from '@synonymdev/react-native-pubky';

const signInRes = await signIn(
  'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855', // Secret Key
  'my-app.example' // Client ID
);
if (signInRes.isErr()) {
  console.log(signInRes.error.message);
  return;
}
console.log(signInRes.value);

const cookieSignInRes = await signInCookie(
  'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855' // Secret Key
);
if (cookieSignInRes.isErr()) {
  console.log(cookieSignInRes.error.message);
  return;
}
console.log(cookieSignInRes.value); // { pubky, capabilities, session_secret }

getHomeserver

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

const getHomeserverRes = await getHomeserver(
  'z4e8s17cou9qmuwen8p1556jzhf1wktmzo6ijsfnri9c4hnrdfty' // Public Key
);
if (getHomeserverRes.isErr()) {
  console.log(getHomeserverRes.error.message);
  return;
}
console.log(getHomeserverRes.value);

signOut

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

const signOutRes = await signOut(
  'grant_or_cookie_session_secret' // grant_secret or session_secret
);
if (signOutRes.isErr()) {
  console.log(signOutRes.error.message);
  return;
}
console.log(signOutRes.value);

createRecoveryFile

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

const createRecoveryFileRes = await createRecoveryFile(
  'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855', // Secret Key
  'passphrase', // Passphrase
);
if (createRecoveryFileRes.isErr()) {
  console.log(createRecoveryFileRes.error.message);
  return;
}
console.log(createRecoveryFileRes.value);

decryptRecoveryFile

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

const decryptRecoveryFileRes = await decryptRecoveryFile(
  'cHVia3kub3JnL3JlY292ZXJ5CkZRt1NHIjxyTo0whSSgTgNrH56MPpGrSxvAQSE0x5FeklVJpNJqcNP4zjdwW/OpdBOsEC1qZ5MI/mcEUKFKVAEZwikdclsLZg==', // Recovery File
  'passphrase', // Passphrase
);
if (decryptRecoveryFileRes.isErr()) {
  console.log(decryptRecoveryFileRes.error.message);
  return;
}
console.log(decryptRecoveryFileRes.value);

startAuthFlow

Start a Grant authentication flow with requested capabilities. Returns a URL to present to the user for approval.

import { startAuthFlow, startCookieAuthFlow } from '@synonymdev/react-native-pubky';

const startRes = await startAuthFlow('/pub/att.app/:rw', 'my-app.example');
if (startRes.isErr()) {
  console.log(startRes.error.message);
  return;
}
console.log(startRes.value); // Auth URL to present to user

const cookieStartRes = await startCookieAuthFlow('/pub/att.app/:rw');
if (cookieStartRes.isErr()) {
  console.log(cookieStartRes.error.message);
  return;
}
console.log(cookieStartRes.value); // Legacy cookie auth URL

awaitAuthApproval

Await approval of a pending Ring auth flow. Returns session info upon approval.

import { awaitAuthApproval, awaitCookieAuthApproval } from '@synonymdev/react-native-pubky';

const approvalRes = await awaitAuthApproval();
if (approvalRes.isErr()) {
  console.log(approvalRes.error.message);
  return;
}
console.log(approvalRes.value); // { pubky, capabilities, grant_secret }

const cookieApprovalRes = await awaitCookieAuthApproval();
if (cookieApprovalRes.isErr()) {
  console.log(cookieApprovalRes.error.message);
  return;
}
console.log(cookieApprovalRes.value); // { pubky, capabilities, session_secret }

putWithSession

Upload content to a path using session-based authentication (instead of a secret key).

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

const putRes = await putWithSession(
  'pubky://z4e8s17cou9qmuwen8p1556jzhf1wktmzo6ijsfnri9c4hnrdfty/pub/app/profile.json', // URL
  JSON.stringify({ name: 'Alice' }), // Content (string)
  'grant_or_cookie_session_secret' // grant_secret or session_secret
);
if (putRes.isErr()) {
  console.log(putRes.error.message);
  return;
}
console.log(putRes.value);

deleteWithSession

Delete content at a path using session-based authentication (instead of a secret key).

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

const deleteRes = await deleteWithSession(
  'pubky://z4e8s17cou9qmuwen8p1556jzhf1wktmzo6ijsfnri9c4hnrdfty/pub/app/profile.json', // URL
  'grant_or_cookie_session_secret' // grant_secret or session_secret
);
if (deleteRes.isErr()) {
  console.log(deleteRes.error.message);
  return;
}
console.log(deleteRes.value);

Local Installation

  1. Clone & npm install:
git clone [email protected]: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

Run React Native Example App

  1. Run Homeserver:
cd rust/pubky/pubky-homeserver && cargo run -- --config=./src/config.toml
  1. Run the React Native Example App:
cd example && yarn install && cd ios && pod install && cd ../ && yarn ios

Download Remote Bindings

This command will download the current bindings from the SDK repo:

npm run update-remote-bindings

Setup Local Bindings

This command will download the entire Rust project if it doesn't exist and set up the bindings locally for faster iteration and testing:

npm run update-local-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