SDKs/phoenixd-ts

phoenixd-ts

This sdk was build by GPT-6.1 Sol. Please get in touch if there are any issues.

Use @nodana/phoenixd-ts to call your Phoenixd node's API from JavaScript or TypeScript. Create invoices, send payments, read balances and payment history, or subscribe to incoming payments. The client provides typed requests and responses.

Install

Use Node.js 22 or later:

npm install @nodana/phoenixd-ts

Create an invoice

Set PHOENIXD_URL to your node's HTTPS endpoint and PHOENIXD_PASSWORD to its restricted password (http-password-limited-access). Keep these settings in your backend's environment.

import { Phoenixd } from "@nodana/phoenixd-ts";

const node = new Phoenixd(process.env.PHOENIXD_URL!, process.env.PHOENIXD_PASSWORD!);

const invoice = await node.createInvoice({
  amountSat: 100,
  description: "Order 123",
});

console.log(invoice.serialized);

Give invoice.serialized to the payer. It is a Lightning invoice for 100 sats. The restricted password supports invoice creation and reading payment information; sending payments requires the full-access password (http-password).

See the Phoenixd API guide for authentication and API details, or use phoenixd-mpp-sdk to charge for API requests through MPP.

On this page