Skip to main content

Walkthrough

Start Here

With UKey Wallet Provider connected in a Nostr app, the page can request the user's public key, ask for event signatures, and use NIP-07-compatible capabilities for common Nostr interactions.

UKey Wallet Nostr Provider follows the NIP-07 specification.

Setup

1. Install UKey Wallet

Install the UKey Wallet browser extension and confirm that the wallet has enabled Nostr related capabilities.

2. API injection instructions

  • The UKey Wallet browser extension injects the Nostr Provider into the page.
  • Available portals include window.$ukey.nostr and compatible portal window.nostr.
  • New projects should read window.$ukey.nostr.

The two entrances have the same capabilities, and window.$ukey.nostr is more suitable for explicitly choosing UKey Wallet.

Detect Provider API support

Before calling the Nostr method, please first check whether the Provider exists on the current page:

const provider = (window.$ukey && window.$ukey.nostr) || window.nostr;

if (!provider) {
alert("Provider unavailable.");
}

API

Select the corresponding interface according to the business goal, such as reading public keys, signing events, or performing message encryption and decryption.

Events

  • Key Event: Account or connection status change.
  • More information: View more