Replies: 2 comments 7 replies
-
Hello! I wanted to ask, what does the "tracks.search" action return? It means what the response text will be. I just wanted to make my app give me a link to the song found through the search. Can you tell me how to do this? |
Beta Was this translation helpful? Give feedback.
-
Hey :) const params = new URLSearchParams();
params.append('grant_type', 'authorization_code');
params.append('code', code);
params.append('redirect_uri', store.redirectURL);
const config = {
headers: {
'Authorization': 'Basic ' + (new Buffer(store.clientID + ':' + store.clientSecret).toString('base64')),
'Content-Type': 'application/x-www-form-urlencoded',
},
};
const tokens = (await axios.post('https://accounts.spotify.com/api/token', params, config))?.data;
await Client.create({
refreshToken: true,
retryOnRateLimit: true,
token: {
clientID: store.clientID,
clientSecret: store.clientSecret,
redirectURL: store.redirectURL,
refreshToken: tokens.refresh_token,
},
async onRefresh() {
await UserStore.findOneAndUpdate(
{ 'spotify.userId': client.user.id },
{ spotify: { refreshToken: client.refreshMeta.refreshToken } },
);
},
}); I also tried to pass |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Start your discussions can contain future updates !
Beta Was this translation helpful? Give feedback.
All reactions