Skip to content

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:

Terminal window
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
{
"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.