- This project only covers the
Authorization code
workflow of OAuth2.0 following the rules mentioned in the Authorization Guide.
- If you want this application to redirect the user to a given frontend application with a valid access_token as a parameter in the url, then check spotify-OAuth2.0-ts-bridge repo.
$ npm install
- Register your app and get your own
client_id
andclient_secret
from the Spotify Developers Dashboard. - To do so, go to your Spotify Developers Dashboard and create your application.
- Then registered Redirect URIs in the app settings,
- The redirect uri must be:
<Your App url>/callback/
- Please make note of
client_id
,client_secret
andredirect_uri
. -
- After creating your app, create a
.env
file in the root folder of the project.
- After creating your app, create a
SPOTIFY_CLIENT_ID = '<your spotify client id>'
SPOTIFY_CLIENT_SECRET = '<your spotify client secret>'
SPOTIFY_CLIENT_REFRESH_TOKEN = '<Refresh Token if available upfront>'
APP_URI = '<url of your app with port included>'
- Note: Incase of development server, your APP_URI will be
http://localhost:3000/
. but if you deployed it in heroku or any other platform, chane the APP_URI accordingly.
- Start script is already included in the
package.json
, so runnpm start
to start the server:
$ npm start