⚠️ This is probably not the way to make a very very secure serverless auth loop! ⚠️ It’s just a fun tech demo. That would probably require a database and other infrastructure, and we don’t need that noise to make this work. This article won’t cover a fully-featured loop for managing authentication, refresh tokens, refresh timeout, etc. Writing a Netlify Function to request data from the Spotify API.Authenticating that app using Postman and Netlify Dev.Setting up an app in Spotify For Developers. Writing a basic callback function for Spotify authentication.Setting up a basic application to display our track info.Here’s a basic outline of what we’re going to do to get this working today: Or check out the deployed version of this site.Check out the code for this at the GitHub Repo.While the authorization flow for Spotify’s API initially threw me for a bit of a loop, this became a really fun way to spend an hour or two. It’s an easy way to show some personality, and mostly just an excuse to get friendly with Netlify Functions. It wasn’t recently, it was in July, please don’t look behind the curtain. I recently* built this really cool feature for my personal website that allows me to use Netlify Functions to show my most-recently-listened-to tracks from Spotify.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |