Giter Club home page Giter Club logo

nostr-zap's Introduction

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/[email protected]"></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

nostr-zap's People

Contributors

samsamskies avatar nostrband avatar dskvr avatar hzrd149 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.