Other Frameworks
💡 The core Bitcoin Connect package works on all frameworks because it is powered by web components. However, a wrapper can simplify usage of Bitcoin Connect.
Use another popular framework? please let us know or feel free to create a PR for a wrapper. See the React package for an example implementation.
Pure HTML
Components
Bitcoin Connect exposes the following web components for allowing users to connect their desired Lightning wallet:
<bc-button/>
- launches the Bitcoin Connect Modal on click- Arguments:
title
- (optional) change the title of the button
- Arguments:
<bc-pay-button/>
- launches the Bitcoin Connect Payment Modal on click- Arguments:
invoice
- BOLT11 invoice. Modal will only open if an invoice is settitle
- (optional) change the title of the buttonpreimage
- (optional) set this if you received an external payment
- Events:
click
- fires when the button is clicked. You can load an invoice here and set it on the button usingsetAttribute('invoice', 'lnbc...')
which will then automatically launch the modalbc:onpaid
- fires event with WebLN payment response inevent.detail
(containspreimage
)
- Arguments:
<bc-connect/>
- render connect wallet UI without modal<bc-payment/>
- render a payment request UI without modal- Arguments:
invoice
- BOLT11 invoicepaid
- Experimental set to true to mark payment was made externally (This will change topreimage
in v4)
- Events:
bc:onpaid
- fires event with WebLN payment response inevent.detail
(containspreimage
)
- Arguments: