uber-client
v0.0.4
Published
Client for the Uber API
Downloads
14
Readme
A Node Uber Client
Introduction
A simple node client that serves as an abstraction for the Uber API.
Installation
Install via NPM
npm install uber-client
Usage
Get Products
Takes a coordinate, and returns a response wrapped in a Promise.
Example
import {UberClient} from 'uber-client';
let client = new UberClient('my-server-token');
return client.getProducts({
latitude: 1,
longitude: 2
});
Get Price Estimates
Takes a price estimates search query, and returns a response wrapped in a Promise.
Price Estimates Search Query
start
(a coordinate)end
(a coordinate)seatCount
(optional)- default value is 2
- maximum value is 2
Example
import {UberClient} from 'uber-client';
let client = new UberClient('my-server-token');
let query = {
start: {
latitude: 1,
longitude: 2,
},
end: {
latitude: 3,
longitude: 4,
},
seatCount: 1,
};
return client.getPriceEstimates(query);
Get Time Estimates
Takes a time estimates search query and returns a response wrapped in a Promise.
Time Estimates Search Query
start
(a coordinate)productId
(optional)- must be a
string
- must be a
Example
import {UberClient} from 'uber-client';
let client = new UberClient('my-server-token');
let query = {
start: {
latitude: 1,
longitude: 2,
},
productId: 'jaebaebae',
};
return client.getTimeEstimates(query);