HabitBridge: A Habit Tracking App For Hackers
Meet HabitBridge - a habit tracking app designed for developers, hackers, and anyone else who wants real control over their digital habit tracking.


HabitBridge aims to be infinitely extensible to make habit tracking more effective and engaging. It combines “traditional” habit tracking features with a robust plugin framework and webhooks to trigger automations and integrate with any system you choose.
Download Now
HabitBridge is available for free on the App Store:
What Makes HabitBridge Different?
Smart Screen Time Management
HabitBridge lets you set limits on distracting apps and only unlocks them after you’ve completed your daily habits. Want to check Instagram? Complete your morning workout first.


The app integrates directly with the iOS system Screen Time APIs.
Manual Habit Tracking
HabitBridge makes it easy to manually track granular-based habits.


Custom Plugin System
This is where HabitBridge truly shines. Install and build your own custom plugins in JavaScript. A plugin defines a unique challenge required to mark that task as complete.
Practice a language, solve math problems, complete a puzzle, or complete creative challenges. Each plugin can have its own UI and logic, allowing for endless possibilities.
Want to share your creations? Submit your plugins to the HabitBridge repo on GitHub for everyone to enjoy. See below on how to build your own!
Webhook Integration
Send your habit data to any system via webhooks, enabling powerful automations. Track your habits in spreadsheets, trigger smart home devices, or integrate with your existing productivity tools.


This can be sent to any web service that accepts webhooks, allowing for endless integration possibilities. Every habit completion is logged with timestamps, making it easy to track your progress programmatically.
Home Assistant
I’ve created a Home Assistant addon to trigger smart home automations based on habit completion.
- Add the repository to your Home Assistant addon store:
- In Home Assistant, go to Settings -> Add-ons -> Add-on Store
- Click the menu (⋮) in the top right corner and select “Repositories”
- Add the URL:
https://github.com/joshspicer/habitbridge-addons
- Click “Add”
- Find and install the “HabitBridge” addon from the add-on store
- Start the addon
- Add
http://<your-home-assistant-ip>:8000/webhook
as the webhook URL in HabitBridge app settings.
After the first webhook is received, several new habitbridge
prefixed sensors will be created in Home Assistant.
Use these sensors to trigger automations based on habit completions.
Enables an LED strip when all habits are completed for the day
Imagine your smart lights changing color when you complete your morning routine, or your coffee maker starting when you finish your workout.
Widgets
See your habit completions at a glance with home screen widgets. More system integrations are planned and coming soon!
Privacy & Data
HabitBridge is designed with privacy in mind. Your habit data stays on your device unless you explicitly choose to export it or send it via webhooks to systems you control. The app contains no ads, trackers, or analytics.
Export Your Data
HabitBridge supports full manual exports as JSON, making it easy to migrate to other systems or perform your own analysis. Import that data back into HabitBridge at any time.
Building Your Own Plugin
The real power of HabitBridge comes from its extensible plugin system. Here’s what you need to know to create your own plugins:
Plugin Structure
Each plugin consists of two key files:
plugin.js
- The JavaScript code that powers your pluginmanifest.json
- Metadata that describes your plugin
API Reference
Method | Description |
---|---|
app.init(callback) |
Entry point for your plugin |
app.renderHTML(htmlString) |
Renders your plugin’s UI |
app.complete() |
Marks the habit as complete |
Global Scope Access
Plugins can expose functions to the global scope for UI interaction in the app’s HTML. This allows you to define event handlers that can be called from HTML elements:
// Make functions accessible from HTML event handlers
window.functionName = () => {
// Function logic
};
app.init(() => {
app.renderHTML(`
<button onclick="functionName()">Click me</button>
`);
});
Get Creative!
Get creative with your plugins! The Morse Code plugin demonstrates how to access device audio capabilities:
// Audio context creation example
const audioContext = new (window.AudioContext || window.webkitAudioContext)();
// Basic audio playback
function playSound() {
const oscillator = audioContext.createOscillator();
const gainNode = audioContext.createGain();
oscillator.connect(gainNode);
gainNode.connect(audioContext.destination);
oscillator.start();
oscillator.stop(audioContext.currentTime + 0.1); // Short beep
}
Example
Here’s a simple example of a HabitBridge plugin that tracks button clicks as a habit challenge. The user must click a button 3 times to complete the habit.
app.init(() => {
let clicks = 0;
app.renderHTML(`
<h1>Click the button to complete</h1>
<button onclick="buttonClick()" class="btn">Click me</button>
<div id="counter">Clicks: 0</div>
<style>.btn { padding: 10px; }</style>
`);
window.buttonClick = () => {
clicks++;
document.getElementById("counter").textContent = `Clicks: ${clicks}`;
if (clicks >= 3) {
app.complete();
}
};
});
Need some more ideas? Check out the Memory Sequence or Meditation Timer plugin source code.


Publishing Your Plugin
Once you’ve created your plugin:
- Clone the HabitBridge repo and create a new folder, named to match the id of your plugin
- Add your
plugin.js
file - Add a
manifest.json
file with your plugin information
{
"id": "word-scramble",
"name": "Word Scramble Challenge",
"description": "Unscramble randomly selected words to complete your habit."
}
- Submit a pull request to have your plugin added to the marketplace
Want to instead use your own marketplace instance? Configure this under ‘Advanced Settings’ in HabitBridge. There you will change the index URL to a URL of your choosing.
Issue Reporting
Find an issue with HabitBridge? Please open an issue on GitHub or contact me. Thanks for reading!
Have a comment? Let me know
This post helpful? Buy me a coffee!