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

Homey.FlowToken

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

The FlowToken class can be used to create a Tag in the Flow Editor.

Table of Contents

Constructor

new Homey.FlowToken(id, opts)

Library:
Parameters:
Name Type Description
id string

ID of the token, should be alphanumeric.

opts Object
Name Type Description
type string

Type of the token, can be either string, number, boolean or image.

title string

Title of the token

Methods

register(callbackopt) → {Promise}

Register the token. This is a shorthand method for ManagerFlow#registerToken.

Parameters:
Name Type Attributes Description
callback function <optional>
Name Type Description
err Error
token FlowToken
Returns:
Type:
Promise

setValue(value, callbackopt) → {Promise}

Set or update the value of the token.

Parameters:
Name Type Attributes Description
value string | number | boolean | Image

The value of the token, should be of the same type as defined in the Token instance

callback genericCallbackFunction <optional>
Returns:
Type:
Promise

unregister(callbackopt) → {Promise}

Unregister the token. This is a shorthand method for ManagerFlow#unregisterToken.

Parameters:
Name Type Attributes Description
callback genericCallbackFunction <optional>
Returns:
Type:
Promise