Next.js - How to setup & use Vercel KV (Redis database)
VloĆŸit
- Äas pĆidĂĄn 26. 08. 2024
- In this video you will learn how to setup and use Vercel KV, key value store like Redis, in your Next.js application. This is a quickstart guide to get you familiar and ready to go with Vercel KV.
Github repo: github.com/tum...
Learn Programming (Skillshare FREE trial): skl.sh/3cYxUP5
My courses:
React basics: skl.sh/2XAKn7u
HTML & CSS for beginners: skl.sh/34wvGUH
Draft.js basics: skl.sh/3cJ5Hw4
đ» MY GEAR
MY CODIGN LAPTOP: amzn.to/3MI90ci
MY MOUSE: amzn.to/3mr3no9
MY KEYBOARD: amzn.to/3GIoMjh
MY MICROPHONE: amzn.to/3KCDPfv
MICROPHONE BOOSTER: amzn.to/43trLWB
MY MICROPHONE ARM: amzn.to/3oaf5DW
MY CAMERA: amzn.to/3UxyvyJ
MY STREAMING LIGHT: amzn.to/3KE0PuE
Connect with me:
Website: tuomokankaanpa...
My newsletter: tuomokankaanpa...
Twitter: / tumee
Skillshare: www.skillshare...
#vercel #redis #nextjs
Thank you so much, you saved my life!
Glad you liked it!
Be careful, on 2:40, you leave it as-is, that means all the production, preview and development KV_REST_API_TOKEN are exactly the SAME! So when you use the `vercel env pull`, that token is identical with production! Same with Vercel Postgres, the DATABASE_URL, which contain database username and password, is the same on 3 environments! I don't know why Vercel do this by default, it's really bad because it's so easy to make mistake.
Thanks so much for this warning.
Second that thanks for the warning.
sir plss make a video on django websocket and redis deployment on vercelđđsir i really find this video in whole youtube but i am unable to find it... Help me as soon as posibleđ
Please advice? In my next.js, I have local "e-commerce cart" saved in Redux. When user signs in, The cart needs to be sent to backed db. NextAuth has signIn callback function, but it fires on API side, where I can't access my redux store to pull cart data.
1. What is the best method to save cart data from Redux to server on login?
2. I am thinking to use Redis as a middleman. right before sign in - save cart to redis, on signIn callback (API) read Redis for cart data. Is this any viable idea? Much appreciated. Solo dev)
Ok, but how do you USE the routes? I can't find out how to actually use these for the life of me. The official documentation doesn't even show it. I'm just trying to use Vercel KV in my app and you can't use it in client components so I'm lost how to get my data.
Same, this video walks through the basic tutorial available
Did you figure out how to use it on client?
Docs say: Vercel KV should be used in server environments, like Vercel Functions, versus from the browser.
I need to put cart data into KV form client (for users not logged in) and once user signs in, read from KV to save cart data on server.
Thanks a lot. crystal clear.
Great to hear!
Thanks!
Cheers!