# @shadowylab/webln

> WebLN - Lightning Web Standard

Latest version **0.1.3** (published 2024-08-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install @shadowylab/webln
pnpm add @shadowylab/webln
yarn add @shadowylab/webln
bun add @shadowylab/webln
```

## Health

**Score 35/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.1.3 |
| Published | 2024-08-17 |
| First published | 2024-01-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >= 10 |
| Dependencies | 0 |
| Unpacked size | 149.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Yuki Kishimoto |
| Maintainers | yukibtc |
| Keywords | webln, lightning, bitcoin, rust, bindings |

## Links

- npm: https://www.npmjs.com/package/@shadowylab/webln
- Repository: https://github.com/shadowylab/webln
- Issues: https://github.com/shadowylab/webln/issues
- Funding: https://getalby.com/p/yuki
- npm.io page: https://npm.io/package/@shadowylab/webln

## Recent versions

- 0.1.3 (latest) — 2024-08-17
- 0.1.2 — 2024-01-23
- 0.1.1 — 2024-01-23
- 0.1.0 — 2024-01-19

## README

# WebLN - Lightning Web Standard

## Getting started

```sh
npm i @shadowylab/webln
```

```javascript
import { WebLN, loadWasmAsync } from '@shadowylab/webln';

async function webln() {
    // Load WASM
    await loadWasmAsync();

    // Compose new WebLN instance
    let webln = new WebLN();

    // Check if WebLN is enabled
    console.log(await webln.isEnabled());

    // Enable WebLN
    await webln.enable();

    // Get info
    let info = await webln.getInfo();
    console.log(info.alias());
    console.log(info.pubkey());
    console.log(info.color());
    console.log(info.methods());

    // Pay invoice
    await webln.sendPayment("bolt11-invoice");

    // Send payment async (needed for HOLD invoices)
    await webln.sendPaymentAsync("bolt11-invoice");

    let response = await webln.getBalance();
    console.log(response.balance);
}
```

## License

This project is distributed under the MIT software license - see the [LICENSE](https://github.com/shadowylab/webln/blob/master/LICENSE) file for details

## Donations

⚡ Tips: https://getalby.com/p/yuki

⚡ Lightning Address: yuki@getalby.com

---
_Source: https://npm.io/package/@shadowylab/webln · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
