Use this sdk to access ozmap plataform and connect it to your own systems
Using npm:
$ npm i --save @ozmap/ozmap-sdk
In Node.js:
// Load the full build.
import OZMapSDK from '@ozmap/ozmap-sdk';
// Creating SDK instance
let ozmap = new OZMapSDK('$OZMAP_URL', '$OZMAP_KEY');
// Authenticating using KEY
await ozmap.authentication();
// Authenticating using User/Password
await ozmap.authentication('$OZMAP_USER', '$OZMAP_PASSWORD');
Usage examples:
After ozmap-sdk@1.0.0:
// Fetching ALL cables
const cables = await ozmap.cable.find();
Before ozmap-sdk@1.0.0:
// Fetching ALL cables
const cables = await ozmap.getCable().getAll();
// Fetch Cable by ID
const cable = await ozmap.getCable().getById('$CABLE_ID');
...