Repository navigation
Developer Guide
Home · API · Supported apps
Better Logic Library exposes shared functionality to Homey apps. The
betterlogiclibrary npm package
is a client/loader; install the BLL Homey app as well. See the
package documentation
and developer forum.
npm install betterlogiclibraryAdd the permission to your app manifest, preserving your other permissions:
{
"permissions": ["homey:app:net.i-dev.betterlogic"]
}Initialize from your Homey app:
const { BL } = require('betterlogiclibrary');
class ExampleApp extends Homey.App {
async onInit() {
await BL.init({ homey: this.homey });
}
}To opt a text argument into BLL coding, decode it before using it:
const decodedText = await BL.decode(args.text);Document which fields you decode and whether BLL is required. In the current
client, BL.decode returns the input unchanged when BLL is not ready;
BL.express can throw when unavailable. Do not silently assume that an
unchanged value was evaluated successfully.
Modules are opt-in. The package documentation demonstrates initializing with
modules: ['_', 'math', 'datetime'] to load shared modules, then using
BL._ and BL.datetime. The loader also exposes other modules such as
number and json. Consult the package documentation and test the version
you ship: availability depends on the BLL app and loader versions.
The client supports options including silent, waitTime and required;
do not assume that optional decoding and required module loading have the same
failure behavior. Handle missing or stopped BLL explicitly for your use case.
Only evaluate trusted expressions and be careful with input that will become
code. Tell users what happens if BLL is unavailable.
Homey apps can call BLL through Homey's app API with the permission above. HomeyScript uses a different client interface. Examples and endpoint details are in API. The permission permits communication; it does not automatically decode your app's Flow arguments.
Support development - If Better Logic Library is useful to you, you can support its
continued development through GitHub Sponsors,
Patreon,
PayPal, or
bunq.
Thank you!