Type "number"

If you are writing a function that requires enter numeric values, you can use environment variables of type number in your implementation. Then our platform will ask consumers to enter their value during installation.

The type number variables allow consumers of a function to enter only numeric values. It is displayed in the installation UI form as an input number element (see image below).

Example of a type "number" environment variable definition

"env": [
    {
        "name": "SCALE",
        "description": "The number of pixels to which you want to set the selected dimension.",
        "required": true,
        "type": "number",
        "default": 20,
        "min": 1,
        "max": 100
    }
]

Example of how to consume the value of the environment variable within the function implementation

const myFunction = () => {
    const scale = Number(process.env.SCALE);
    ...
};

module.exports = myFunction;

Properties of the type

Last updated