You are currently viewing the Homey Apps SDK v2 documentation. New apps should use Homey Apps SDK v3 ››

Homey.App

const { App } = require('homey');

The App class is your start point for any app. This class should be extended and exported from app.js. Methods prefixed with on are meant to be overriden. It is not allowed to overwrite the constructor.

Table of Contents

Example

/app.js

const Homey = require('homey');

class MyApp extends Homey.App {

  onInit() {
    this.log('My App is running!');
  }

}

module.exports = MyApp;

Extends

Methods

error(…message)

Log a message to the console (stderr)

Overrides:
Parameters:
Name Type Attributes Description
message * <repeatable>

log(…message)

Log a message to the console (stdout)

Overrides:
Parameters:
Name Type Attributes Description
message * <repeatable>

onInit()

This method is called upon initialization of your app