Skip to content

Files

examples

node-unifi class usage examples

This directory contains some javascript code examples which demonstrate usage of the node-unifi class and can be used as a good starting point for your own custom code.

Usage

You can either copy the examples files here to your own working directory, edit and run them. All you have to modify is the require('../unifi.js') statement, which should be changed to require('node-unifi') once node-unifi has been globally installed. Or you run these examples directly in here.

Executing scripts from the command-line

Most of the included example scripts can be run from a command shell:

$ ./first-steps.js <IP> <PORT> <USERNAME> <PASSWORD>

Just replace all <...> identifiers with the proper parameters so that the script can directly communicate with the selected UniFi controller.

Contribute

If you would like to share your own example file(s), please open an issue and include your code there or else create a pull request.

Important Disclaimer

Use these examples at your own risk!