Skip to content

Instantly share code, notes, and snippets.

View SaDi-BRo's full-sized avatar
🔇
Trying

SaDi SaDi-BRo

🔇
Trying
View GitHub Profile
@mcpeblocker
mcpeblocker / spotify.js
Created September 3, 2022 12:27
Getting access_token (for Bearer auth) from spotify using your app credentials.
const client_id = "YOUR_CLIENT_ID"
const client_secret = "YOUR_CLIENT_SECRET"
const refresh_token = "YOUR_REFRESH_TOKEN"
const basic = Buffer.from(`${client_id}:${client_secret}`).toString('base64')
const TOKEN_ENDPOINT = `https://accounts.spotify.com/api/token`
const getAccessToken = async () => {
const response = await fetch(TOKEN_ENDPOINT, {