Skip to content

Instantly share code, notes, and snippets.

@iamhunter
Created June 15, 2017 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iamhunter/bb4f495f2ebf3cbee3c719b01016d616 to your computer and use it in GitHub Desktop.
Save iamhunter/bb4f495f2ebf3cbee3c719b01016d616 to your computer and use it in GitHub Desktop.
Spotify Setup
var SpotifyWebApi = require('spotify-web-api-node');
var scopes = ['user-read-private', 'user-read-email', 'playlist-modify-public'],
redirectUri = '',
clientId = '',
state = '';
var spotifyApi = new SpotifyWebApi({
clientId : '',
clientSecret : '',
redirectUri : ''
});
// Create the authorization URL
var authorizeURL = spotifyApi.createAuthorizeURL(scopes, state);
// https://accounts.spotify.com:443/authorize?client_id=5fe01282e44241328a84e7c5cc169165&response_type=code&redirect_uri=https://example.com/callback&scope=user-read-private%20user-read-email&state=some-state-of-my-choice
console.log(authorizeURL);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment