mirror of
https://github.com/aljazceru/pubky-core.git
synced 2025-12-31 21:04:34 +01:00
Pubky
JavaScript implementation of Pubky.
Install
npm install @synonymdev/pubky
Getting started
import PubkyClient from "@synonymdev/pubky";
// Initialize PubkyClient with Pkarr relay(s).
let client = new PubkyClient();
// Generate a keypair
let keypair = Keypair.random();
// Create a new account
let homeserver = PublicKey.try_from("8pinxxgqs41n4aididenw5apqp1urfmzdztr8jt4abrkdn435ewo");
await client.signup(keypair, homeserver)
// Verify that you are signed in.
const session = await client.session(publicKey)
Test and Development
For test and development, you can run a local homeserver in a test network.
If you don't have Cargo Installed, start by installing it:
curl https://sh.rustup.rs -sSf | sh
Clone the Pubky repository:
git clone https://github.com/pubky/pubky
cd pubky/pkg
Run the local testnet server
npm run testnet