Code Examples
Fast-track your NWC integration with these examples
TypeScript Project (NodeJS, Browser, React Native)
Install the SDK
npm install @getalby/sdkyarn add @getalby/sdkQuick Start
import { LN } from "@getalby/sdk";
const credentials = "nostr+walletconnect://..."; // the NWC connection credentials
const ln = new LN(credentials);
// to send
await ln.pay("lnbc..."); // pay a lightning invoice
// generate an invoice and act upon it once it's paid
const request = await ln.receive({satoshi: 21});
request.onPaid(giveAccess);Web Project
Bitcoin Connect
Alby JS SDK
Mobile Project
Last updated
Was this helpful?