Git Product home page Git Product logo

flippa-js's Introduction

flippa

JavaScript API client for the Flippa.com API.

Installation

npm install --save flippa

Authentication

An access token can be requested using one of the supported OAuth2 grants:

flippa = new Flippa();
flippa
  .authenticate({
    grant_type: "client_credentials",
    client_id: "123",
    client_secret: "shh"
  })
  .then(function(response) {
    // Authentication succeeded; can now make authorized requests.
    console.log(flippa.accessToken());
  })

The granted access token is stored in the client instance, meaning subsequent requests using the same client do not need to authenticate again.

Alternately, the API client can be provided an access token directly when constructed:

flippa = new Flippa({accessToken: "some_token"});

Examples

Retrieving open listings by user 123:

flippa
  .listings
  .list({filter: {status: "open", user_id: 123}})
  .then(function(response) {
    console.log(response.body.data);
  })

For more usage examples, see the documentation.

Timeout

All requests timeout after 15s by default. This is configurable via the timeout option (in ms).

Example:

// set default timeout to 10s
var flippa = new Flippa({timeout: 10000});

Development

Running tests:

$ make build test

Contributing

This project follows semantic versioning.

In order to make a change, do so from a feature branch and pull request the project. Your pull request should not include a version change. Instead, make an addition to the "head" version in the CHANGELOG that briefly describes the change and ideally links to the pull request.

When releasing a new version, bump the version according to semver in package.json, then push and publish it:

$ TAG=v1.2.3 make build test publish tag

flippa-js's People

Contributors

ags avatar bradbarrow avatar jeanmarcgoepfert avatar

Stargazers

mduvernon avatar

Watchers

James Cloos avatar Rozman avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.