0.22.0 • Published 3 months ago

nostr-zap v0.22.0

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

nostr-zap

NPM

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@0.22.0"></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.22.0

3 months ago

0.21.0

10 months ago

0.20.0

10 months ago

0.19.0

10 months ago

0.18.0

11 months ago

0.17.0

11 months ago

0.16.0

11 months ago

0.15.0

11 months ago

0.14.0

11 months ago

0.13.0

11 months ago

0.12.0

11 months ago

0.11.0

11 months ago

0.10.0

12 months ago

0.9.1

12 months ago

0.9.0

12 months ago

0.8.0

12 months ago

0.7.0

12 months ago

0.6.0

12 months ago

0.5.0

12 months ago

0.4.0

1 year ago

0.3.0

1 year ago

0.2.1

1 year ago

0.2.0

1 year ago

0.1.7

1 year ago

0.1.6

1 year ago

0.1.5

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago