Skip to content

Latest commit

 

History

History
44 lines (34 loc) · 1.24 KB

README.md

File metadata and controls

44 lines (34 loc) · 1.24 KB

meteor-accounts-spotify

An updated and maintained meteor package for Spotify's login service.

Installation

  • meteor add xinranxiao:accounts-spotify

Usage

Go to Spotify's website and register an application. For your redirect URL, enter: <yourhostname>/_oauth/spotify?close

Configure the Spotify service (server-side):

ServiceConfiguration.configurations.update(
  { "service": "spotify" },
  {
    $set: {
      "clientId": "<your clientId>",
      "secret": "<your secret>"
    }
  },
  { upsert: true }
);

Login on the client:

var options = {
  showDialog: true, // Whether or not to force the user to approve the app again if they’ve already done so.
  requestPermissions: ['user-read-email'] // Spotify access scopes.
};
Meteor.loginWithSpotify(options, function(err) {
  console.log(err || "No error");
});

The user's services.spotify and profile fields will be populated on success. If you just want the access token without user accounts being involved, check out xinranxiao:spotify.

Contribution

If you have any problems with or suggestions for this package, please create a new issue.

TODO

  • allow specification of the fields to use for the profile.