Skip to content

Deprecation of Core and BridgeCore

Ben edited this page Nov 1, 2026 · 6 revisions

As of releases before 0.7.0 users were advised to download the HAP-NodeJS repository and startup HAP-NodeJS using Core.ts and BridgeCore.ts to load accessories located in the accessories folder.
This way of using HAP-NodeJS was deprecated with the release of 0.7.0, and it was removed in v1.0.0 (July 2024). AccessoryLoader, which turned object literal accessories into real ones, was removed in v1.0.0 too.

The following reasons lead to the decision to deprecate this style of creating accessories:

  • It is and was always difficult for users to update to the latest version of HAP-NodeJS. In certain circumstances merge conflicts could appear making an update even more difficult.
  • It brought some inflexibility. For example, it is not really possible to delay publishing of the accessory, which is important for some applications where devices need to be discovered on the network first.
  • It is hard to share and maintain your custom accessories. For example publishing those to GitHub or releasing them would always require the whole library to be published.
  • There is the potential, that users are running an unstable version of HAP-NodeJS as the default branch may not always be stable and include changes not yet released.
  • With the latest migration to Typescript it got less straight forward for users to set up and start their accessories.

As a result we strongly encourage users to write their plugins using HAP-NodeJS as a library. There is a guide to get you started: Beginners guide for using HAP-NodeJS as a library.

Migration

First of all, you may have a look at the already mentioned Beginners guide for using HAP-NodeJS as a library.

But in short:

  • You will need to set up a new node project. You can choose to write your plugin in JavaScript or Typescript.
  • You will need to add "@homebridge/hap-nodejs" to your list of dependencies in your package.json. The easiest way is to run npm install @homebridge/hap-nodejs in your project folder.
  • You may need to move your persist folder into the new location where your project will be running in order to keep up the pairing between your accessories and your home.
  • Move your code over to the new project. You can basically keep the code pretty much the same if you are using standalone accessories (You have to write your own Bridge if you were using the BridgeCore). You will need to adjust the imports at the top and add a accessory.publish call at the bottom.
    If you used object literal notation (a plain object describing the accessory), you will need to rewrite it using new Accessory(...) and Service objects, as shown in the guide, because AccessoryLoader no longer exists.

For further guidance you can refer to the HAP-NodeJS Examples repository. Please note that it still uses a very old version (hap-nodejs v0.6).

Installation

Homebridge Help

Homebridge UI Help

Versioning

Plugins

Raspberry Pi Image
Docker
Synology Package
HAP-NodeJS

Developers

Clone this wiki locally