- Built-in TypeScript support, including intellisense and type safety.
- Works both with Node.js and directly in the browser.
- Only 1 dependency,
isomorphic-unfetchto support older browsers.
- Up to date with OptimoRoute API v1.17
- See the project at npmjs.com/optimoroute-client
Download from NPM
npm install optimoroute-clientor build it yourself
git clone https://github.com/rokala/optimoroute-client.git
cd ./optimoroute-client
npm installYou need a API authentication key provided by OptimoRoute
// Import the module
import OptimoRoute from 'optimoroute-client';
// Initialize the client, never expose your key to the public
const api = new OptimoRoute({
authKey: '<YourOptimoRouteApiKey>'
});
// Some example requests
api.getOrders('SomeOrderNumber-123')
.then((response) => {
// do stuff...
});
api.getSchedulingInfo('SomeOrderNumber-123')
.then((response) => {
// do stuff...
});
api.getRoutes({ date: '2021-10-01' })
.then((response) => {
// do stuff...
});
api.updateDriverParameters({ externalId: 'SomeDriverID-123', date: '2020-10-01', enabled: false })
.then((response) => {
// do stuff...
});