Package Exports
- lyft-client
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (lyft-client) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
node-lyft-client
A Lyft client for calling Lyft's public API endpoints. See their API reference for more information.
Installation
npm install lyft-clientUsage
Sign up for a lyft developer account
here. You will get a client id and
a client secret. You will need these to initialize a Lyft client
object.
// commonjs
const { Lyft } = require('lyft-client');
// es2015
import Lyft from 'lyft-client';
const CLIENT_ID = // your client id
const CLIENT_SECRET = // your client secret
const 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 to load your private Lyft tokens.
npm install dotenvCreate a file named .env in the root of your project:
LYFT_CLIENT_ID=MY_CLIENT_ID
LYFT_CLIENT_SECRET=MY_CLIENT_SECRETThen use dotenv to load your .env file into your environment:
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 for more documentation.
License
Credits
Forked from djchie/lyft-node.