This is a simple application that provides an API for authenticating your Spotify app with an account. You can get oauth token an refresh tokens using this API. For everything else, please use the official API described in https://developer.spotify.com/documentation/web-api/reference/
The app requires the following environment variables to be set in a .env file in the root of the project:
SPOTIFY_CLIENT_ID: Your Spotify Client ID.SPOTIFY_CLIENT_SECRET: Your Spotify Client Secret.SPOTIFY_REDIRECT_URI: Your Spotify Redirect URI.
-
Create a Spotify Developer Account:
- Go to the Spotify Developer Dashboard.
- Log in with your Spotify account or create a new one.
-
Create a New Application:
- Click on "Create App".
- Fill in the required details and click "Create".
-
Set Redirect URI:
- In the app dashboard, go to the "Settings" tab.
- Add a Redirect URI (e.g.,
http://localhost:3000/callback).
-
Get Client ID and Client Secret:
- After creating the app, you will be redirected to the app dashboard.
- Copy the
Client IDandClient Secretfrom the dashboard.
-
Create a
.envFile:- In the root of your project, create a file named
.env. - Add the following lines to the
.envfile:
- In the root of your project, create a file named
SPOTIFY_CLIENT_ID=your_client_id_here
SPOTIFY_CLIENT_SECRET=your_client_secret_here
SPOTIFY_REDIRECT_URI=your_redirect_uri_hereRun this as any other node.js api.
git clone https://github.com/yourusername/spotify-api-app.git spotify-web-app
cd spotify-api-app
npm install
npm run start