Home / Companies / Upstash / Blog / Post Details
Content Deep Dive

Periodic Data Updates with Next.js and Vercel Serverless Functions

Blog post from Upstash

Post Details
Company
Date Published
Author
Andreas Thomas
Word Count
927
Language
English
Hacker News Points
-
Summary

This text provides a guide on using QStash to create a serverless, scheduled function within a Next.js application to periodically fetch and store the current USD price of Bitcoin from blockchain.info into a Redis database. It outlines the setup process, including creating a Next.js application, installing the necessary dependencies (@upstash/redis and @upstash/qstash), and configuring an API handler to fetch and store data. The handler function is wrapped with verifySignature to ensure requests are from Upstash, and the application is deployed on Vercel with necessary environment variables. The final step involves using QStash to set a schedule for the function, allowing it to run periodically without additional infrastructure.