Never Pummel Muskoxen

    This package has been deprecated

    Author message:

    abandoned and unmaintained

    mlh-api

    1.0.1 • Public • Published

    MLH API

    NPM version

    A wrapper for the Major League Hacking (MLH) API.

    Install

    Install with npm:

    $ npm i mlh-api --save

    Usage

    Configuring the module:

    const mlh = require('./index')
     
    mlh.configure({
      clientId: 'YOUR_CLIENT_ID',
      clientSecret: 'YOUR_CLIENT_SECRET',
      redirectUri: 'YOUR_REDIRECT_URI'
    })

    Authorization Code Flow

    Redirect your user to this url:

    const url = mlh.authorizationCodeUrl(['your', 'scopes', 'here'])

    Get the authorization code from the MLH callback to obtain an access token:

    mlh.accessTokenFromAuthorizationCode(code).then(() => {
      // Module is now configured with the access token
      // Get user object
      return mlh.user()
    }).then(user => {
      // Do stuff with user object
    })

    Implicit Authorization Flow

    Redirect your user to this url:

    const url = mlh.implicitAuthorizationUrl(['your', 'scopes', 'here'])

    Set the access token from the MLH callback:

    mlh.configure({ accessToken: token })
     
    // Make user requests
    mlh.users(1, 100).then(users => {
      // Do stuff with users
    })

    Please visit the module documentation and the MLH API documentation for more information

    Contributing

    Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

    Author

    Tomer Aberbach

    License

    Copyright © 2018 Tomer Aberbach Released under the MIT license.

    Install

    npm i mlh-api

    DownloadsWeekly Downloads

    3

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    7.88 kB

    Total Files

    4

    Last publish

    Collaborators

    • tomeraberbach