Login UI
LoginButton and useSession share the session provided by NostrSdkProvider. Supported methods include NIP-07, NIP-46, key generation, and key import. Install the UI package directly when importing its components and styles.
terminal
$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>;
}