Concepts
The ideas every other page builds on.
Learn these once. Every other page in this guide uses them without explaining them again.
- LoaderStarts Unbound inside Discord
- UnboundLoads your addon
- Your pluginFinds, patches and listensYou write this
- Discord's codeRuns as usual
Addons
An addon is anything a user installs into Unbound. There are four kinds.
| Kind | What you ship | Code |
|---|---|---|
| Plugin | A JavaScript bundle | Yes |
| Theme | A JSON palette and an optional background | No |
| Icon pack | A folder of images | No |
| Font | A font file | No |
Every addon has a manifest: manifest.json, which holds its id, name, version and authors. See The Manifest.
Workspace
A workspace is the folder you build addons in. ubd, Unbound's CLI, creates it, builds each addon in it, and sends them to your phone.
Bridge
The bridge is a small server on your computer that your phone connects to. Through it, ubd installs and reloads addons, and you read your phone's logs. See Debugger.
Lifecycle
Unbound calls your plugin's start when the user turns it on, and stop when they turn it off. Most plugins only write start. See Lifecycle.
Addon Scope
Each plugin runs with its own Addon scope: its own patcher, logger, timers and listeners. Unbound records everything registered through it and removes it all when the plugin stops. That is why most plugins need no stop.
Feature
A feature is one part of a plugin, in its own folder under src/, with its own start function. One feature that throws never stops the others. See Plugin Anatomy.
Modules and Metro
Discord's app is JavaScript split into thousands of modules. One sends messages, one draws a button. Metro is the system that loads them. They have no stable names, so you find one by what it exports:
import { metro } from '@unbound-app/api';
const Messages = metro.findByProps('sendMessage', 'receiveMessage');Lookups are lazy: the search runs the first time you use the result, so it never slows Discord's launch. See Finding Modules.
Patch
A patch wraps one of Discord's functions with your code. It runs before the function, after it, or instead of it. Components are functions too, so patches also change what Discord shows. See Patching Functions and Patching Components.
Flux Stores and Actions
A Flux store holds part of Discord's state, such as the current user or the selected channel. A Flux action is an event, such as MESSAGE_CREATE, that tells stores something happened. Read a store for state. Listen for an action to react. See Flux Stores.
Settings and Buckets
You declare a plugin's settings once in settings.ts. Unbound saves them and builds the settings panel for you. Each plugin's saved values live in its own bucket. See Settings and Storage.
Message Keys
A plugin never hard-codes text it shows. It uses message keys from i18n/en-US.json, and Unbound picks the user's language. See Translations.