While we are here, we need to edit the applications settings.Ĭlick the 'Edit settings' button and fill out the redirect URL to include this one: Now head back to your app and create a. Once you are done, you need to retrieve the Client ID and Client Secret from the app detail page. Give this app a name and description and accept the terms. You can then go ahead a create a new app. Head over to the Spotify dashboard for developers and log in with your Spotify account. You can run the app by navigating to the folder and running the following command. npm install that's it, all the dependencies we need. Then we need to install some dependencies for NextAuth to work.
Give your app a cool name, and you're ready to roll. All we need to do for this is run the following command. We'll start by creating a new Next.js project. I'll guide you through the whole process step by step. This is an excellent example of using NextAuth.js in Next.js and talking to the Spotify API.ĭon't worry if you don't have any experience yet. In this article, we will authenticate a user with the Spotify API and retrieve their playlists! How to authenticate a user with Spotify in Next.js and query their playlists 26 Oct, 2021