|
8 | 8 | [](./LICENSE) |
9 | 9 | [](https://github.com/lnbits/lnbits) |
10 | 10 |
|
11 | | -# Example Extension - <small>[LNbits](https://github.com/lnbits/lnbits) extension</small> |
| 11 | +# LNbits Extension Starter Template |
12 | 12 |
|
13 | | -<small>For more about LNBits extension check [this tutorial](https://github.com/lnbits/lnbits/wiki/LNbits-Extensions)</small> |
| 13 | +A **starter template for developers** to build new LNbits extensions with a clean, well-structured foundation. |
14 | 14 |
|
15 | | -<h2>*tagline*</h2> |
16 | | -This is an example extension to help you organise and build you own. |
| 15 | +This repository provides a ready-to-use extension skeleton that follows LNbits conventions and best practices, making it easier to build, test, and maintain custom extensions. |
17 | 16 |
|
18 | | -Try to include an image |
19 | | -<img src="https://i.imgur.com/9i4xcQB.png"> |
| 17 | +[](https://www.youtube.com/watch?v=aRTRYcNwqj0) |
20 | 18 |
|
21 | | -<h2>If your extension has API endpoints, include useful ones here</h2> |
| 19 | +## Purpose |
22 | 20 |
|
23 | | -<code>curl -H "Content-type: application/json" -X POST https://YOUR-LNBITS/YOUR-EXTENSION/api/v1/EXAMPLE -d '{"amount":"100","memo":"example"}' -H "X-Api-Key: YOUR_WALLET-ADMIN/INVOICE-KEY"</code> |
| 21 | +This template is designed to: |
| 22 | + |
| 23 | +- Serve as a **clonable base structure** for new LNbits extensions |
| 24 | +- Demonstrate **recommended LNbits extension patterns** |
| 25 | +- Reduce setup time for new extension projects |
| 26 | +- Encourage consistency across the LNbits extension ecosystem |
| 27 | + |
| 28 | +It is the **recommended starting point** if you want to develop your own LNbits extension with proper structure and conventions. |
| 29 | + |
| 30 | +## Features |
| 31 | + |
| 32 | +The template includes: |
| 33 | + |
| 34 | +- Example extension layout (backend + frontend) |
| 35 | +- Sample database models |
| 36 | +- Example API endpoints |
| 37 | +- Configuration and metadata files |
| 38 | +- Support for **symbolic linking** to simplify local development |
| 39 | +- Clear separation of logic, views, and API routes |
| 40 | + |
| 41 | +All components are intentionally minimal and meant to be adapted or extended. |
| 42 | + |
| 43 | +## API Example |
| 44 | + |
| 45 | +If your extension exposes API endpoints, document them clearly. |
| 46 | +Below is a simple example request pattern: |
| 47 | + |
| 48 | +``` |
| 49 | +curl -H "Content-type: application/json" \ |
| 50 | + -H "X-Api-Key: YOUR_WALLET_ADMIN_OR_INVOICE_KEY" \ |
| 51 | + -X POST https://YOUR-LNBITS/YOUR-EXTENSION/api/v1/example \ |
| 52 | + -d '{"amount": 100, "memo": "example"}' |
| 53 | +``` |
| 54 | + |
| 55 | +Replace the endpoint, payload, and permissions according to your extension logic. |
| 56 | + |
| 57 | +## Development Notes |
| 58 | + |
| 59 | +* This template supports **symbolic linking** for local LNbits development setups |
| 60 | +* Intended for developers familiar with LNbits and its extension system |
| 61 | +* You are expected to modify, remove, or extend all example logic |
| 62 | + |
| 63 | +### Important |
| 64 | + |
| 65 | +If you are using **LLMs to generate code**, please make sure to follow the official LNbits instructions when configuring your model to avoid insecure or incompatible output. |
| 66 | + |
| 67 | +## Learn More |
| 68 | + |
| 69 | +* LNbits core repository: [https://github.com/lnbits/lnbits](https://github.com/lnbits/lnbits) |
| 70 | +* Extension documentation: [https://github.com/lnbits/lnbits/wiki/LNbits-Extensions](https://github.com/lnbits/lnbits/wiki/LNbits-Extensions) |
| 71 | +* Official website: [https://lnbits.com](https://lnbits.com) |
24 | 72 |
|
25 | 73 | ## Powered by LNbits |
26 | 74 |
|
27 | | -[LNbits](https://lnbits.com) is a free and open-source lightning accounts system. |
| 75 | +LNbits is a free and open-source Lightning accounts system. |
28 | 76 |
|
29 | | -[](https://shop.lnbits.com/) |
30 | | -[](https://my.lnbits.com/login) |
| 77 | +[](https://shop.lnbits.com/) |
| 78 | +[](https://my.lnbits.com/login) |
0 commit comments