https://github.com/djchie/lyft-node
This is a Node.js Wrapper for the Lyft API's public scope endpoints
https://github.com/djchie/lyft-node
lyft lyft-api lyft-api-wrapper lyft-node lyft-node-api lyft-public-api
Last synced: 9 months ago
JSON representation
This is a Node.js Wrapper for the Lyft API's public scope endpoints
- Host: GitHub
- URL: https://github.com/djchie/lyft-node
- Owner: djchie
- License: mit
- Created: 2017-03-04T09:54:45.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-03-25T05:31:59.000Z (almost 9 years ago)
- Last Synced: 2025-04-30T08:56:05.259Z (9 months ago)
- Topics: lyft, lyft-api, lyft-api-wrapper, lyft-node, lyft-node-api, lyft-public-api
- Language: JavaScript
- Size: 12.7 KB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
[](https://travis-ci.org/djchie/lyft-node)
[](https://coveralls.io/github/djchie/lyft-node?branch=master)
[](https://badge.fury.io/js/lyft-node)
[](https://nodei.co/npm/lyft-node/)
# A Node Wrapper for the Lyft API
## Introduction
A simple node wrapper that serves as an abstraction for the Lyft API's public scope endpoints.
## Installation
Install via NPM
```
npm install lyft-node
```
## Usage
### Get Ride Types
Takes a ride types search query and returns a response wrapped in a Promise.
#### Ride Types Search Query
##### Required:
* `start [coordinate]`
##### Optional:
* `rideType [string]` (must be `lyft`, `lyft_line`, or `lyft_plus`)
#### Example
```javascript
import Lyft from 'lyft-node';
const lyft = new Lyft('LYFT_CLIENT_ID', 'LYFT_CLIENT_SECRET');
const query = {
start: {
latitude: 1,
longitude: 2,
},
};
lyft.getRideTypes(query)
.then((result) => {
console.log(result);
})
.catch((error) => {
console.log(error);
});
```
### Get Driver ETA
Takes a driver eta search query and returns a response wrapped in a Promise.
#### Driver ETA Search Query
##### Required:
* `start [coordinate]`
##### Optional:
* `end [coordinate]`
* `rideType [string]` (must be `lyft`, `lyft_line`, or `lyft_plus`)
#### Example
```javascript
import Lyft from 'lyft-node';
const lyft = new Lyft('LYFT_CLIENT_ID', 'LYFT_CLIENT_SECRET');
const query = {
start: {
latitude: 1,
longitude: 2,
},
};
lyft.getDriverEta(query)
.then((result) => {
console.log(result);
})
.catch((error) => {
console.log(error);
});
```
### Get Ride Estimates
Takes a ride estimates search query and returns a response wrapped in a Promise.
#### Ride Estimates Search Query
##### Required:
* `start [coordinate]`
* `end [coordinate]`
##### Optional:
* `rideType [string]` (must be `lyft`, `lyft_line`, or `lyft_plus`)
#### Example
```javascript
import Lyft from 'lyft-node';
const lyft = new Lyft('LYFT_CLIENT_ID', 'LYFT_CLIENT_SECRET');
const query = {
start: {
latitude: 1,
longitude: 2,
},
end: {
latitude: 3,
longitude: 4,
},
rideType: 'lyft',
};
lyft.getRideEstimates(query)
.then((result) => {
console.log(result);
})
.catch((error) => {
console.log(error);
});
```
### Get Nearby Drivers
Takes a nearby drivers search query and returns a response wrapped in a Promise.
#### Time Estimates Search Query
##### Required:
* `start [coordinate]`
#### Example
```javascript
import Lyft from 'lyft-node';
const lyft = new Lyft('LYFT_CLIENT_ID', 'LYFT_CLIENT_SECRET');
const query = {
start: {
latitude: 1,
longitude: 2,
},
};
lyft.getNearbyDrivers(query)
.then((result) => {
console.log(result);
})
.catch((error) => {
console.log(error);
});
```
## License
[MIT](LICENSE.md)
## Credits
This project is heavily inspired by [Jae Bradley](https://github.com/jaebradley)'s [uber-client](https://github.com/jaebradley/uber-client)