What is Nostr?
/ 0x80085
npub1n8qโ€ฆfqkr
2024-12-25 14:07:05

0x80085 on Nostr: #asknostr #dev #nostr #christmas #code ๐Ÿง‘โ€๐Ÿ’ปโ“๐ŸŽ„ MERRY XMAS QUESTION THREAD ...

#asknostr #dev #nostr #christmas #code

๐Ÿง‘โ€๐Ÿ’ปโ“๐ŸŽ„ MERRY XMAS QUESTION THREAD ๐Ÿงต

Trying out some #nostr ways to add payment features. Are there better xmways out there than alby?

Install the SDK with npm or yarn: npm install @getalby/sdk
Use the SDK to handle payments. Here's a quick example of how you might set it up

This setup allows your app to request payments and handle them using the Lightning Network through Nostr protocol with minimal code.

const Alby = require('@getalby/sdk');
const alby = new Alby();

// Connect to a wallet
alby.connect('nostr://your-connection-secret');

// Request a payment
const invoice = await alby.requestInvoice({
amount: 100, // in satoshis
description: 'Payment for service'
});

// Assuming you have some way to display or process this invoice for payment
console.log(invoice);
Author Public Key
npub1n8qwa5x82cst04y0lfzemz3g0tpvpapy837zvrzrkmmswd9t5r3sjmfqkr