Skip to content

Instantly share code, notes, and snippets.

View jabedzaman's full-sized avatar

Jabed Zaman jabedzaman

View GitHub Profile
@jabedzaman
jabedzaman / spotify.js
Last active June 16, 2024 22:37
Fetch currently playing song on Spotify
// pages/api/spotify.
import querystring from 'querystring';
const {
NEXT_PUBLIC_SPOTIFY_CLIENT_ID: client_id,
NEXT_PUBLIC_SPOTIFY_CLIENT_SECRET: client_secret,
NEXT_PUBLIC_SPOTIFY_REFRESH_TOKEN: refresh_token,
} = process.env;