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.
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.
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.
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.
Use these examples at your own risk!