uber-client

0.0.4 • Public • Published

Build Status Coverage Status npm version

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

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);

Readme

Keywords

none

Package Sidebar

Install

npm i uber-client

Weekly Downloads

0

Version

0.0.4

License

MIT

Last publish

Collaborators

  • jaebradley