Authorizing
Authorizing with Vibify. You can use the authorize
method to get the authorization URL for the user to authorize your application.
async function authorize(userId) { return await vibify.authorize(userId);}
const link = authorize('user-id');console.log("URL: ", link);
Or with cURL:
curl https://localhost:3000l/authorize/user-id
Response
Url: https://accounts.spotify.com/authorize?client_id=your-client-id&response_type=code&redirect_uri=http://localhost:3000/callback&scope=user-read-email%20user-read-private%20user-library-read%20user-top-read%20user-read-recently-played%20user-read-currently-playing%20user-follow-read%20playlist-read-private%20playlist-modify-public%20playlist-modify-private%20playlist-read-collaborative%20user-library-modify&state=your-name
Response after clicking the link
{ "api_token":"7d5649cd1bd7253ddbd15e098459f15ba04..."}
Scopes
Scopes let you specify exactly what type of access you need. Scopes limit access for OAuth tokens. They do not grant any additional permission beyond that which the user already has. In this case, the SDK already has the necessary scopes for what it’s capable of doing.
Spotify Scopes The set of scopes you pass in your authentication request determines the access permissions that the user is asked to grant.