Pay a lightning invoice and change the color of your Philips Hue lightstrip, lightbulb, etc.
Simple proof of concept that demonstrates how a no-code Strike tipping widget could be built.
WARNING: This is a proof of concept and is designed to be embedded directly in client side code. Please ensure that the Strike API key you use allows for limited access only.
REQUIRED API SCOPES:
partner.invoice.quote.generate
partner.invoice.read
partner.invoice.create-for-receiver
partner.account.profile.read
- Load the javascript into you html page
- Create a div with the id
strke-widget
- set
data-apikey
to your Strike API key - set
data-handle
to the strike username to tip - set
data-amount
to the amount to tip
<script type="text/javascript" src="/path/to/js/bundle.js" defer></script>
<div class="strike-widget"
data-apikey="[YOUR LIMITED SCOPE API KEY HERE]"
data-handle="[STRIKE USERNAME TO TIP]"
data-amount="[AMOUNT TO TIP]"
data-theme="default"/>
Install dependencies:
npm install
Build the widget:
npm run build:widget
This will create javascript and css bundles and copy them to the widget
directory.
After building, you can test the build by serving the js and css bundles and then opening the example app:
npx serve widget
Then in a new tab, open the example page in your browser:
open example/index.html
The code is essentially a very basic react app which you can start like so:
npm start