Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 73 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,78 @@
# Example Extension - <small>[LNbits](https://github.com/lnbits/lnbits) extension</small>
<a href="https://lnbits.com" target="_blank" rel="noopener noreferrer">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://i.imgur.com/QE6SIrs.png">
<img src="https://i.imgur.com/fyKPgVT.png" alt="LNbits" style="width:280px">
</picture>
</a>

<small>For more about LNBits extension check [this tutorial](https://github.com/lnbits/lnbits/wiki/LNbits-Extensions)</small>
[![License: MIT](https://img.shields.io/badge/License-MIT-success?logo=open-source-initiative&logoColor=white)](./LICENSE)
[![Built for LNbits](https://img.shields.io/badge/Built%20for-LNbits-4D4DFF?logo=lightning&logoColor=white)](https://github.com/lnbits/lnbits)

<h2>*tagline*</h2>
This is an example extension to help you organise and build you own.
# LNbits Extension Starter Template

Try to include an image
<img src="https://i.imgur.com/9i4xcQB.png">
A **starter template for developers** to build new LNbits extensions with a clean, well-structured foundation.

<h2>If your extension has API endpoints, include useful ones here</h2>
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.

<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>
[![Watch the video](https://img.youtube.com/vi/aRTRYcNwqj0/maxresdefault.jpg)](https://www.youtube.com/watch?v=aRTRYcNwqj0)

## Purpose

This template is designed to:

- Serve as a **clonable base structure** for new LNbits extensions
- Demonstrate **recommended LNbits extension patterns**
- Reduce setup time for new extension projects
- Encourage consistency across the LNbits extension ecosystem

It is the **recommended starting point** if you want to develop your own LNbits extension with proper structure and conventions.

## Features

The template includes:

- Example extension layout (backend + frontend)
- Sample database models
- Example API endpoints
- Configuration and metadata files
- Support for **symbolic linking** to simplify local development
- Clear separation of logic, views, and API routes

All components are intentionally minimal and meant to be adapted or extended.

## API Example

If your extension exposes API endpoints, document them clearly.
Below is a simple example request pattern:

```
curl -H "Content-type: application/json" \
-H "X-Api-Key: YOUR_WALLET_ADMIN_OR_INVOICE_KEY" \
-X POST https://YOUR-LNBITS/YOUR-EXTENSION/api/v1/example \
-d '{"amount": 100, "memo": "example"}'
```

Replace the endpoint, payload, and permissions according to your extension logic.

## Development Notes

* This template supports **symbolic linking** for local LNbits development setups
* Intended for developers familiar with LNbits and its extension system
* You are expected to modify, remove, or extend all example logic

### Important

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.

## Learn More

* LNbits core repository: [https://github.com/lnbits/lnbits](https://github.com/lnbits/lnbits)
* Extension documentation: [https://github.com/lnbits/lnbits/wiki/LNbits-Extensions](https://github.com/lnbits/lnbits/wiki/LNbits-Extensions)
* Official website: [https://lnbits.com](https://lnbits.com)

## Powered by LNbits

LNbits is a free and open-source Lightning accounts system.

[![Visit LNbits Shop](https://img.shields.io/badge/Visit-LNbits%20Shop-7C3AED?logo=shopping-cart\&logoColor=white\&labelColor=5B21B6)](https://shop.lnbits.com/)
[![Try myLNbits SaaS](https://img.shields.io/badge/Try-myLNbits%20SaaS-2563EB?logo=lightning\&logoColor=white\&labelColor=1E40AF)](https://my.lnbits.com/login)
11 changes: 9 additions & 2 deletions config.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
{
"id": "example",
"version": "1.0.6",
"name": "Build your own!",
"repo": "https://github.com/lnbits/example",
"short_description": "Extension building guide",
"description": "",
"tile": "/example/static/bitcoin-extension.png",
"min_lnbits_version": "1.0.0",
"donate": "donate@legend.lnbits.com",
"contributors": [
{
"name": "Ben Arc",
Expand All @@ -29,5 +32,9 @@
],
"description_md": "https://raw.githubusercontent.com/lnbits/example/main/description.md",
"terms_and_conditions_md": "https://raw.githubusercontent.com/lnbits/example/main/toc.md",
"license": "MIT"
"license": "MIT",
"paid_features": "",
"tags": ["Utilities", "Developer"],
"donate": "",
"hidden": false
}
17 changes: 10 additions & 7 deletions description.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
An easily clonable extension that can be used a base for building a new extension.
A starter template for developers to build new LNbits extensions.

THe usual development enviroment is:
Its functions include:

- Clone the myextension repo to your own repo
- Edit the cloned repos manifest to your details
- Install into LNbits
- Delete the cloned extensions folder in your LNbits install
- Create a symbolic link to the extensions folder, from the where you have pulled your extension `ln -s /where/you/cloned/myextension /your/lnbits/installl/lnbits/lnbits/extensions/`
- Providing a clonable base structure for new extensions
- Demonstrating LNbits extension patterns and best practices
- Including example API endpoints and database models
- Supporting symbolic linking for local development

The recommended starting point for developers who want to create custom LNbits extensions with proper structure and conventions.

Note: If you are using LLMs to generate Code, please use our Instructions to feed your Modal.
Loading