Options
All
  • Public
  • Public/Protected
  • All
Menu

lyft-client

npm travis

node-lyft-client

A Lyft client for calling Lyft's public API endpoints. See their API reference for more information.

Installation

npm install lyft-client

Usage

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 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:

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

MIT

Credits

Forked from djchie/lyft-node.

Generated using TypeDoc