0.21.4 • Published 9 months ago

nostr-zap-fork v0.21.4

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

nostr-zap

NPM

This is a dark mode theme fork of Sam Samskies' nostr-zap. I take no credit for the idea or functionality of this component. Special thanks to Sam for his open source contribution to the nostr ecosystem.

Zap any Nostr npub or note from anywhere.

Usage

Specify a target npub using a data-npub attribute on any HTML elements that you would like to turn into click targets. Optionally, you can specify a note ID using a data-note-id attribute if you'd like to zap a specific note. You can also optionally specify relays that you'd like the zap receipt published to using a data-relays attribute. If you don't add a data-relays attribute, the zap receipt will be blasted out to the top 300 relays using Blastr (wss://nostr.mutinywallet.com).

If the user doesn't have an ext that supports nip-07 installed or does not authorize signing the zap event, an anonymous zap will be sent.

<button
    data-npub="npub1vp8fdcyejd4pqjyrjk9sgz68vuhq7pyvnzk8j0ehlljvwgp8n6eqsrnpsw"
    data-relays="wss://relay.damus.io,wss://relay.snort.social,wss://nostr.wine,wss://relay.nostr.band"
>
  Zap Me ⚡️
</button>

Add this script tag right before the bottom closing body tag.

<script src="https://cdn.jsdelivr.net/npm/nostr-zap-fork@0.21.4"></script>

Example Sandbox with 1 button: https://codesandbox.io/s/nostr-zap-from-anywhere-poc-wiyzgm

Example Sandbox with multiple buttons: https://codesandbox.io/s/nostr-zap-from-anywhere-multiple-buttons-6qp79r

Example Sandbox with note ID: https://codesandbox.io/s/nostr-zap-note-from-anywhere-bugme4

nostr-zap demo

0.21.4

9 months ago

0.21.3

9 months ago

0.21.2

9 months ago

0.21.1

9 months ago

0.21.0

9 months ago