JSPM

lyft-client

1.0.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 5
  • Score
    100M100P100Q37862F
  • License MIT

This is a Node.js Wrapper for the Lyft API's public scope endpoints

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

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.