Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi user config #479

Open
DJHammers opened this issue Jan 5, 2023 · 1 comment
Open

Multi user config #479

DJHammers opened this issue Jan 5, 2023 · 1 comment

Comments

@DJHammers
Copy link

let spotifyApi = new SpotifyWebApi();
        spotifyApi
            .authorizationCodeGrant(`auth code`)
            .then(function (data) {
                console.log('Retrieved access token', data.body['access_token']);
                spotifyApi.setAccessToken(data.body['access_token']);
                return spotifyApi.getMe();
            })
            .then(function (data) {
                console.log('Retrieved data for ' + data.body['display_name']);
                console.log('Image URL is ' + data.body.images[0].url);

                console.log('This user has a ' + data.body.product + ' account');
            })
            .catch(function (err) {
                console.log('Something went wrong:', err.message);
            });

am using this on multiuser project so it only use authorizationCodeGrant to fetch user why its giving

Something went wrong: An authentication error occurred while communicating with Spotify's Web API.
Details: invalid_client.

the readme file says client is optional

// credentials are optional
var spotifyApi = new SpotifyWebApi({
  clientId: 'fcecfc72172e4cd267473117a17cbd4d',
  clientSecret: 'a6338157c9bb5ac9c71924cb2940e1a7',
  redirectUri: 'http://www.example.com/callback'
});

but actually they are required how do i fix this

@DJHammers
Copy link
Author

i need to log in to bot like spotify-web-api-js npm it only require accesstoken

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant