Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bschlenk/node-lyft-client
This is a Node.js Wrapper for the Lyft API's public scope endpoints
https://github.com/bschlenk/node-lyft-client
Last synced: 2 days ago
JSON representation
This is a Node.js Wrapper for the Lyft API's public scope endpoints
- Host: GitHub
- URL: https://github.com/bschlenk/node-lyft-client
- Owner: bschlenk
- License: mit
- Created: 2018-09-03T22:48:55.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-03T17:01:41.000Z (almost 2 years ago)
- Last Synced: 2024-11-05T17:54:52.114Z (10 days ago)
- Language: TypeScript
- Size: 624 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 26
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
[![npm][npm]][npm-url]
[![travis][travis]][travis-url]# node-lyft-client
A Lyft client for calling Lyft's public API endpoints. See [their API
reference](https://developer.lyft.com/reference) for more information.## Installation
```sh
npm install lyft-client
```## Usage
Sign up for a lyft developer account
[here](https://www.lyft.com/developers). You will get a `client id` and
a `client secret`. You will need these to initialize a `Lyft` client
object.```typescript
// commonjs
const { Lyft } = require('lyft-client');// es2015
import Lyft from 'lyft-client';const CLIENT_ID = // your client id
const CLIENT_SECRET = // your client secretconst lyft = new Lyft(CLIENT_ID, CLIENT_SECRET);
lyft.getRideTypes({
latitude: /* latitude coordinate */,
longitude: /* longitude coordinate */,
}).then((response) => {
// do something with the response
});```
I recommend using [dotenv](https://www.npmjs.com/package/dotenv) to load
your private Lyft tokens.```sh
npm install dotenv
```Create a file named `.env` in the root of your project:
```
LYFT_CLIENT_ID=MY_CLIENT_ID
LYFT_CLIENT_SECRET=MY_CLIENT_SECRET
```Then use `dotenv` to load your `.env` file into your environment:
```js
require('dotenv').config();
const { Lyft } = require('lyft-client');const lyft = new Lyft(
process.env.LYFT_CLIENT_ID,
process.env.LYFT_CLIENT_SECRET,
);
```See
[bschlenk.github.io/node-lyft-client](http://bschlenk.github.io/node-lyft-client/docs/classes/_lyft_.lyft.html)
for more documentation.## License
[MIT](LICENSE.md)
## Credits
Forked from [djchie/lyft-node](https://github.com/djchie/lyft-node).
[npm]: https://img.shields.io/npm/v/lyft-client.svg?logo=npm
[npm-url]: https://npmjs.com/package/lyft-client
[travis]: https://img.shields.io/travis/bschlenk/node-lyft-client/master.svg?logo=travis
[travis-url]: https://travis-ci.org/bschlenk/node-lyft-client