Skip to content

Dennis14e/node-opnsense

Repository files navigation

Node OPNsense Client API (node-opnsense)

npm npm bundle size Build CodeQL

This Node Client API is mostly based on the documentation here and the source code here. However, it is known that the documentation is not always up to date.

Not every one of these APIs have been tested. It is possible that e.g. input parameters may be missing.

Use at your own risk.

Example

const OPNsense = require('./src/index');

const client = new OPNsense.Client(
    'https://opnsense.local/',
    'api-key',
    'api-secret'
);

new OPNsense.Wol.WolClient(client).wakeByMAC('AA:BB:CC:00:11:22').then(res => {
    console.log(res);
});

NPM scripts

Command Description
npm run lint Lint code in ./src
npm run jsdoc Generate documentation ./docs
npm run openapi Generate OpenAPI file ./openapi/openapi.json