npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-lyft-sairam

v1.0.3

Published

The official node SDK for Lyft's APIs

Downloads

10

Readme

Lyft Node SDK

node-lyft is a Node client library for accessing the Lyft API.

Registration

You must first create a Lyft Developer account here. Once registered, create a new application here. Your new application will be assigned a Client ID and Client Secret (for use with two- or three-legged OAuth to generate bearer tokens and User Authentication) and a Client Token (for use with public endpoints that don't require user context/Client Authentication).

Installation

npm

Install the latest version via npm:

npm install node-lyft

yarn

Install the latest version via yarn:

yarn add node-lyft

For Development/Pull Requests

First clone the lyft-node-sdk repo locally:

git clone github.com/lyft/lyft-node-sdk

Within the cloned directory, run npm install or yarn install. Now you can install this package locally for development.

Usage

Prior to calling API endpoints, you need to authenticate. For public endpoints, you can use the Client Token from your application; for user-specific endpoints, you need to use a token generated from the three legged OAuth2 process, detailed in the documentation.

var lyft = require('node-lyft');
var defaultClient = lyft.ApiClient.instance;
//next you need to authorize API access.
//if you're only using your Client Token for non-user specific endpoints, you can add that token directly
defaultClient.authentications['Client Authentication'].accessToken = 'YOUR-CLIENT-TOKEN';
//if you're using endpoints that require a user context, you need to get your token via three-legged OAuth, then add it here:
defaultClient.authentications['User Authentication'].accessToken = '3-LEGGED-OAUTH-TOKEN';

With proper authorization, you can now call Lyft's API. Below we are calling the ETA endpoint with a lyftPublicApi instance.

//create a new lyft-node PublicApi() instance
var lyftPublicApi = new lyft.PublicApi()
//the getETA endpoint works with both user and non-user context:
//leaving the options field empty {}
//and using promises/then to print out result
lyftPublicApi.getETA(37.7884, -122.4076, {}).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Documentation for API Endpoints

All URIs are relative to https://api.lyft.com/v1

Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- lyft.PublicApi | getCost | GET /cost | Cost estimates lyft.PublicApi | getDrivers | GET /drivers | Available drivers nearby lyft.PublicApi | getETA | GET /eta | Pickup ETAs lyft.PublicApi | getRideTypes | GET /ridetypes | Types of rides lyft.SandboxApi | setPrimeTime | PUT /sandbox/primetime | Preset Prime Time percentage lyft.SandboxApi | setRideStatus | PUT /sandbox/rides/{id} | Propagate ride through ride status lyft.SandboxApi | setRideTypeAvailability | PUT /sandbox/ridetypes/{ride_type} | Driver availability for processing ride request lyft.SandboxApi | setRideTypes | PUT /sandbox/ridetypes | Preset types of rides for sandbox lyft.UserApi | cancelRide | POST /rides/{id}/cancel | Cancel a ongoing requested ride lyft.UserApi | getProfile | GET /profile | The user's general info lyft.UserApi | getRide | GET /rides/{id} | Get the ride detail of a given ride ID lyft.UserApi | getRideReceipt | GET /rides/{id}/receipt | Get the receipt of the rides. lyft.UserApi | getRides | GET /rides | List rides lyft.UserApi | newRide | POST /rides | Request a Lyft lyft.UserApi | setRideDestination | PUT /rides/{id}/destination | Update the destination of the ride lyft.UserApi | setRideRating | PUT /rides/{id}/rating | Add the passenger's rating, feedback, and tip

Documentation for Models

Support

If you're looking for help configuring or using the SDK, or if you have general questions related to our APIs, the Lyft Developer Platform team provides support through our forum as well as on Stack Overflow (using the lyft-api tag).

Reporting security vulnerabilities

If you've found a vulnerability or a potential vulnerability in node-lyft, please let us know at [email protected]. We'll send a confirmation email to acknowledge your report, and we'll send an additional email when we've identified the issue positively or negatively.