Note: Donkie declined - wants to keep Spoolman focused
Rationale
Some features are too niche for core but valuable to specific users:
Moonraker integration / auto-set spool ID
Home Assistant webhooks
Custom automation triggers
Slicer-specific integrations
Hardware integrations (scales, NFC readers)
Plugin system lets community build these without forking.
Possible Approaches
Option A: Backend Hooks (Python)
# plugins/my_plugin.pyfromspoolman.pluginsimporthook@hook("spool.created")asyncdefon_spool_created(spool):# Custom logicpass@hook("spool.used")asyncdefon_spool_used(spool,amount):# Notify Home Assistantpass
Option B: Webhook Events
Configure webhook URLs in settings
Fire HTTP POST on events (spool created, used, low stock)
Simple, no code needed
Option C: Frontend Plugins (JS)
Load custom JS from plugins directory
Add custom buttons/panels to UI
More complex but powerful
Events to Hook
spool.created, spool.updated, spool.deleted
spool.used (filament consumed)
spool.low_stock (below threshold)
filament.created, filament.imported
print_job.created, print_job.completed
qr.scanned
Recommendation
Start with Option B (Webhooks) - simplest, covers 80% of use cases.
Add Option A (Python hooks) later for advanced users.
Complexity
This is a significant architectural addition. Consider:
Security implications of running user code
API stability for plugins
Documentation burden
Maybe lower priority than core features
## Summary
Add a plugin architecture to allow community extensions without modifying core code.
## Upstream Issue
- https://github.com/Donkie/Spoolman/issues/72
- Note: Donkie declined - wants to keep Spoolman focused
## Rationale
Some features are too niche for core but valuable to specific users:
- Moonraker integration / auto-set spool ID
- Home Assistant webhooks
- Custom automation triggers
- Slicer-specific integrations
- Hardware integrations (scales, NFC readers)
Plugin system lets community build these without forking.
## Possible Approaches
### Option A: Backend Hooks (Python)
```python
# plugins/my_plugin.py
from spoolman.plugins import hook
@hook("spool.created")
async def on_spool_created(spool):
# Custom logic
pass
@hook("spool.used")
async def on_spool_used(spool, amount):
# Notify Home Assistant
pass
```
### Option B: Webhook Events
- Configure webhook URLs in settings
- Fire HTTP POST on events (spool created, used, low stock)
- Simple, no code needed
### Option C: Frontend Plugins (JS)
- Load custom JS from plugins directory
- Add custom buttons/panels to UI
- More complex but powerful
## Events to Hook
- `spool.created`, `spool.updated`, `spool.deleted`
- `spool.used` (filament consumed)
- `spool.low_stock` (below threshold)
- `filament.created`, `filament.imported`
- `print_job.created`, `print_job.completed`
- `qr.scanned`
## Recommendation
Start with **Option B (Webhooks)** - simplest, covers 80% of use cases.
Add **Option A (Python hooks)** later for advanced users.
## Complexity
This is a significant architectural addition. Consider:
- Security implications of running user code
- API stability for plugins
- Documentation burden
- Maybe lower priority than core features
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Add a plugin architecture to allow community extensions without modifying core code.
Upstream Issue
Rationale
Some features are too niche for core but valuable to specific users:
Plugin system lets community build these without forking.
Possible Approaches
Option A: Backend Hooks (Python)
Option B: Webhook Events
Option C: Frontend Plugins (JS)
Events to Hook
spool.created,spool.updated,spool.deletedspool.used(filament consumed)spool.low_stock(below threshold)filament.created,filament.importedprint_job.created,print_job.completedqr.scannedRecommendation
Start with Option B (Webhooks) - simplest, covers 80% of use cases.
Add Option A (Python hooks) later for advanced users.
Complexity
This is a significant architectural addition. Consider: