/github-profile-spotify-status

Beautiful Spotify status (including current playing song, recently played songs, and favourite artist) for github profiles

Primary LanguageEJSApache License 2.0Apache-2.0

Spotify Stats for Github Profile

License Contributing

Spotify Stats for Github Pofile generates a beautiful Spotify status (including current playing song, recently played songs, and favourite artist) for github profiles.

Technically, it's a serverless function that generates a SVG image based on your Spotify state. It can be deployed on every faas providors (specially Vercel). Also It is using EJS out of the box to inject data into SVG image.

Demo

Table of contents

Requirements

  1. Spotify App
  2. Vercel account

Before deploying this app on vercel, you need to create a Spotify app in Spotify developer dashboard. Using this app, you can access users' information (actually your information).

How to create a Spotify app?

  1. Login to Spotify developer dashboard.
  2. Click on Create an app button and chose a name and description for your app (e.g name: github-profile, description: for github profile status)
  3. Store the Client ID and Client Secret in a safe place because we have to use them in the deployment process.

Deploy on Vercel

Using this Deploy with Vercel button, you can start the deployment on vercel.

On the deployment process, after setting a git repository,

On the Configure Project set these environment variables:

  • SPOTIFY_CLIENT_ID : Use your Spotify app client id
  • SPOTIFY_CLIENT_SECRET: Use your Spotify app client secret
  • SPOTIFY_REFRESH_TOKEN: Use a random value here, it will change after deployment process

After deployment

  1. open the deployed app and go to /init endpoint
  2. Complete information about how to set refresh token is mentioned on the /init endpoint. Follow the instructions to generate Refresh token.

After setting the refresh token, go to the root path / and see the result :)