What problem does it solve?
Scanned QR codes often arrive in varied formats and require accurate interpretation and routing. This Skill provides a robust flow to classify camera-scanned content (Bitcoin addresses, Lightning invoices, Lightning addresses, Nostr npubs, Cashu tokens, and unknown data) and dispatch it to the appropriate handlers, with a reliable clipboard paste alternative.
Core Features & Use Cases
- Camera-based QR scanning with automatic content classification and error handling.
- Paste-from-clipboard fallback to support text-based QR data when a camera is unavailable.
- Content-type routing: bitcoin_address, lightning_invoice, lightning_address, npub, cashu_token, unknown.
- Accessibility considerations and cleanup to prevent resource leaks in UI.
- Use Case: Developer adds QR scanning to a wallet app to accept Lightning invoices or Cashu tokens by scanning or pasting QR data.
Quick Start
Install html5-qrcode in your project and integrate the hooks and component; ensure a div with id "qr-reader" exists; start scanning and handle results, with a clipboard paste option as a fallback.