Node.js
Introduction
Learn how to send and receive instant Bitcoin payments with Node.js and ZBD.
Prerequisites
To complete this guide, you will need the following:
1. Create a Node.js project
Start with a brand new empty directory called node-example
and run the following command to initiate a Node.js project:
2. Install @zbd/node Node.js SDK
Install ZBD:
3. Send and receive Bitcoin
Create a new file called index.js
and add the following code:
Run the following command to start your Node.js server:
You may need to add a
start
script to your package.json
file such as node index.js
.You’re looking for the data.invoice.request
property in the JSON response. It starts with lnbc1
and is the payment request anyone in the Bitcoin Lightning Network can use to pay you.
3. Try it yourself
You can now send and receive instant Bitcoin payments using Express.js + ZBD!
Was this page helpful?