Twitter API Requests with NextAuth.js Session Tokens & Next.js Serverless Functions

Published: 06 August 2021
on channel: Colby Fayock
5,817
135

Learn how to use an authenticated NextAuth.js Twitter session to make requests to the Twitter API in serverless functions.

🧐 What's Inside
00:00 - Intro to Twitter API Requests with NextAuth.js
00:11 - Tools we'll use including Next.js, NextAuth.js, Twitter API, and Twitter Lite
01:41 - Starting a new NextAuth.js authenticated app
02:36 - Configuring API keys to log in with Twitter
03:40 - Using the NextAuth.js JWT callback to access Twitter oAuth tokens
07:26 - Creating a Next.js serverless function for making authenticated Twitter search requests
14:50 - Parsing request body to grab search query in serverless function
15:54 - Using Twitter Lite to make a request to the Twitter API
19:05 - Creating a new serverless function to compose and post new Tweets to Twitter
22:24 - Outro

Previous Tutorial
   • Next.js Authentication with Twitter &...  

Previous Tutorial Starting Point Demo
https://github.com/colbyfayock/my-aut...

Demo Code
https://github.com/colbyfayock/my-nex...

🗒️ Read More
https://spacejelly.dev/posts/how-to-m...

🔔 Subscribe for more tech and developer videos
https://www.youtube.com/colbyfayock?s...

🐦 Get updates straight to your Twitter @colbyfayock
  / colbyfayock  

📸 Catch the next stream live on Twitch @colbyfayock
  / colbyfayock  

✉️ Or a newsletter right to your inbox!
https://www.colbyfayock.com/newsletter/

💝 Sponsor me for more free content like this!
GitHub: https://github.com/sponsors/colbyfayock
Other: [email protected]

👨‍🚀 Brought to by colbyfayock.com
https://www.colbyfayock.com

🎥 Want to know what A/V equipment I use?
https://www.colbyfayock.com/what-i-use

🧰 More Resources

NextAuth.js
https://next-auth.js.org

Twitter API v1.1
  / v1  

Securing pages and API routes
https://next-auth.js.org/tutorials/se...

🎼 Music
Music from Uppbeat (free for Creators!):
https://uppbeat.io/t/bakerman/permafrost
License code: NKOMVJOOIRHMU6DV

#colbyfayock #nextauthjs #twitterapi #twitter #nextjs #authentication #webdevelopment