Skip to content

LiquidC0de/serverless-spotify-auth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Serverless Spotify Auth

Netlify Status

This project demonstrates OAuth 2.0 authentication via the Authorization Code Flow for the Spotify Web API using Netlify serverless functions. In essence, the Spotify Web API example has been adapted to use Netlify functions on the backend and Create React App on the frontend.

Spotify App Setup

Use your Spotify account on the Spotify developer site to create an app and get a Client ID and Client Secret. You need to set up your redirect URI on the Spotify dashboard.

Redirect URI for Local Development

http://localhost:8888/.netlify/functions/callback

Deploy

Deploy to Netlify

Local Development

Create a file called .env to store environment variables.

REACT_APP_CLIENT_ID="your client id here"
REACT_APP_CLIENT_SECRET="your client secret here"

Never share your Client ID in public such as in a git repository.

Local Development

In the project directory, install the packages:

yarn

Set up Netlify CLI if you have not done so.

npm install netlify-cli -g

Login to your Netlify account:

ntl login

Start the app:

ntl dev

Open http://localhost:8888 to view it in the browser.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published