@webbtc/webln-types
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "@webbtc/webln-types", | ||
"description": "Type definitions for WebLN", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"types": "types/index.d.ts", | ||
@@ -14,3 +14,4 @@ "repository": { | ||
"scripts": { | ||
"publish": "npm publish --access public" | ||
"npm:bump-version": "npm version patch", | ||
"npm:publish": "npm publish --access public" | ||
}, | ||
@@ -17,0 +18,0 @@ "bugs": { |
# webln-types | ||
Type definitions for WebLN | ||
Type definitions for [WebLN](https://webbtc.dev/webln) | ||
## Quick Start | ||
1. Install package | ||
```bash | ||
npm install @webbtc/webln-types --save-dev # or yarn add @webbtc/webln-types --dev | ||
``` | ||
2. Add the following line somewhere in your codebase (e.g. the main/index.tsx file) | ||
```javascript | ||
/// <reference types="@webbtc/webln-types" /> | ||
``` | ||
3. Type definitions are now available for `window.webln` | ||
```javascript | ||
if (window.webln) { | ||
(async () => { | ||
await window.webln.enable(); | ||
console.log(await window.webln.getInfo()); | ||
})(); | ||
} else { | ||
console.warn("WebLN not enabled"); | ||
} | ||
``` | ||
## Adding WebLN to your application | ||
Read the [WebLN Guide](https://www.webln.guide/introduction/readme) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4649
35