---
name: wavelength-web
description: Embed a self-custodial Lightning wallet in a web app with the Wavelength SDK (@lightninglabs/wavelength-web, @lightninglabs/wavelength-react, @lightninglabs/wavelength-core). Use when integrating Wavelength into a browser or React app, creating a wallet client, sending or receiving Lightning payments in the browser, wiring WavelengthProvider, hosting wasm runtime assets, or adding passkey protection. Triggers include "wavelength", "embed a Lightning wallet", "createWebWalletEngine", "WavelengthProvider", "useWalletPasskey", and "wavelength runtime assets".
title: wavelength-web
canonical_url: https://skilld.dev/gh/lightninglabs/wavelength-sdk/wavelength-web
last_updated: 2026-11-01T19:15:52.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> If the user asked to install this Skill, run `npx skilld install lightninglabs/wavelength-sdk/wavelength-web`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/wavelength-web`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/lightninglabs/wavelength-sdk/wavelength-web) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/wavelength-web`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/wavelength-web --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/wavelength-web --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# Wavelength web integration

Wavelength embeds a self-custodial Lightning wallet in a web app. The wallet
daemon runs as WebAssembly in a Web Worker in the user's browser; there is no
node to run, no channels to open, and no inbound liquidity to manage.

Docs index: https://wavelength.lightning.engineering/llms.txt. Every docs page
has a markdown twin at the same URL with `.md` appended; fetch those.

## Packages

Check the npm registry for current versions; do not rely on memorized ones.

- `@lightninglabs/wavelength-web`: the browser transport. `createWebClient()`
  builds a raw client; `createWebWalletEngine()` wraps it in a `WalletEngine`
  and is the factory to use with the React provider. Re-exports everything
  from core.
- `@lightninglabs/wavelength-react`: `<WavelengthProvider>` plus hooks. Takes an
  injected engine; it does not depend on the web package.
- `@lightninglabs/wavelength-core`: the transport-agnostic contract and types.
  Install it directly only when building a custom binding.

## Task routing

| Building | Read first |
| --- | --- |
| Any new integration | https://wavelength.lightning.engineering/web/get-started/quickstart.md |
| React app | https://wavelength.lightning.engineering/integrations/react.md |
| Wallet creation and unlock | https://wavelength.lightning.engineering/guides/create-a-wallet.md |
| Sending payments | https://wavelength.lightning.engineering/guides/send-a-payment.md |
| Receiving payments | https://wavelength.lightning.engineering/guides/receive-a-lightning-payment.md |
| Passkey protection | https://wavelength.lightning.engineering/guides/use-a-passkey.md |
| Asset hosting or COOP/COEP issues | https://wavelength.lightning.engineering/web/get-started/hosting-runtime-assets.md |

## Critical rules

- Create the engine with `createWebWalletEngine()` from wavelength-web and
  inject it into React via `<WavelengthProvider engine={...}>`. Never import
  wavelength-web inside framework-agnostic or react-only modules; the react
  package deliberately has no dependency on the web transport.
- The wasm runtime assets are self-hosted by the embedding app. Copy them to
  a public directory and point `runtimeBaseUrl` at it. There is no CDN
  default yet; a missing or wrong `runtimeBaseUrl` is the most common
  integration failure.
- A Content-Security-Policy must allow `script-src blob:`. The runtime loader
  always executes the bootstrap scripts (`wasm_exec.js`, `sqlite-bridge.js`)
  from a blob URL rather than a `<script src>`; a CSP without `blob:` breaks
  the SDK outright. See
  https://wavelength.lightning.engineering/web/get-started/hosting-runtime-assets.md.
- Passkey ceremonies are injected. Pass `webPasskeyCeremony` from
  wavelength-web into `useWalletPasskey(ceremony)`; do not implement WebAuthn
  calls by hand.
- The daemon persists to OPFS. Wallet state survives reloads; test flows
  must unlock an existing wallet rather than recreating it on every load.
- Wallet state arrives as a lowercase string union (for example "ready");
  daemon JSON is camelCase at the SDK boundary. Do not pattern-match proto
  numeric states or PascalCase field names from daemon-level docs.

## Verify the integration

After wiring, confirm: the app builds, the engine's `phase` (from
`useWallet()`) reaches `ready`, and an invoice can be created. Reload the
page and unlock to confirm persistence.
