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

rdio

v3.1.0

Published

[![NPM version](https://badge.fury.io/js/rdio.png)](http://badge.fury.io/js/rdio) [![Dependency Status](https://david-dm.org/dawnerd/node-rdio.png)](https://david-dm.org/dawnerd/node-rdio.png)

Downloads

25

Readme

node-rdio

node-rdio is a wrapper for the rdio web service api.

NPM version Dependency Status

Installation

npm install rdio --save

Upgrading from < 3.0.0

Rdio is now requiring apps to switch over to OAuth 2.0. You can read more about that here. The gist of it is you will need to create a new app and change how your app interfaces with the node-rdio module.

Good news is the module is much simpler to use and setup.

HUGE thanks to help from @siboulet for bringing the module up to date. I've just gone in and merged it with my older v2.0 branch that was still using OAuth 1.0.

Usage

var Rdio = require('rdio'){
  rdio: {
    clientId: //client id from app manage page
    clientSecret: //client secret from app manage page
  }
};

// in a route or somewhere not global
var rdio = new Rdio({/*tokens*/}, {/*options*/});
  • (optional) Tokens should be passed in via an object that contains an accessToken and refreshToken.

  • (optional) Options can extend any of the defaults:

{
  urls: {
    auth: 'https://www.rdio.com/oauth2/authorize',
    token: 'https://services.rdio.com/oauth2/token',
    resource: 'https://services.rdio.com/api/1/'
  },
  rdio: {
    clientId: "",
    clientSecret: ""
  }
}

When requesting an access token, your app must redirect the user to a url similar to:

https://www.rdio.com/oauth2/authorize?response_type=code&client_id=<clientId>&redirect_uri=<redirect_uri>

You can then take that code param and finalize the request:

rdio.getAccessToken({
  code: request.query.code,
  redirect: 'http://localhost:8000/auth'
}, function(err) {
  if (err) {
    return reply(err);
  }

  reply.redirect('/user');
});

If everything went right you should see the accessToken and refreshToken set. To check this you can call rdio.getTokens()

For a more complete example checkout the example app in examples/hapi/.

Unauthenticated calls

You can now make calls that only require client authentication by using the rdio.getClientToken method. See the example directory for usage.

Something go wrong?

Feel free to leave an issue if something is not working right. I've tested this with a few endpoints and it works, but there still may be some bugs lingering around.