Nostr WoT

Interfaccia di accesso

LoginButton e useSession condividono la sessione di NostrSdkProvider. I metodi supportati includono NIP-07, NIP-46, generazione e importazione delle chiavi. Installa direttamente il pacchetto UI per importarne componenti e stili.

terminale
$npm install @nostr-wot/ui@2.0.0 nostr-wot-sdk@3.0.0 nostr-tools react react-dom
tsx
"use client";
import { LoginButton, useSession } from "@nostr-wot/ui";
import { NostrSdkProvider } from "nostr-wot-sdk/react";
import "@nostr-wot/ui/styles.css";

function Account() {
  const { pubkey } = useSession();
  return <><LoginButton /><output>{pubkey}</output></>;
}

function App() {
  return <NostrSdkProvider><Account /></NostrSdkProvider>;
}