Next.js - How to setup & use Vercel KV (Redis database)

SdĂ­let
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

Komentáƙe • 14

  • @charles-henrynoah9518
    @charles-henrynoah9518 Pƙed rokem +1

    Thank you so much, you saved my life!

  • @SangDang
    @SangDang Pƙed rokem +4

    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.

    • @peterwhite6837
      @peterwhite6837 Pƙed 8 měsĂ­ci

      Thanks so much for this warning.

    • @MikeBritton
      @MikeBritton Pƙed 6 měsĂ­ci

      Second that thanks for the warning.

  • @utkarshpatel4077
    @utkarshpatel4077 Pƙed 24 dny +1

    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😓

  • @lexsemenenko
    @lexsemenenko Pƙed 10 měsĂ­ci +2

    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)

  • @Grynjolf
    @Grynjolf Pƙed rokem +2

    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.

    • @zacboyles1396
      @zacboyles1396 Pƙed rokem

      Same, this video walks through the basic tutorial available

    • @lexsemenenko
      @lexsemenenko Pƙed 10 měsĂ­ci

      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.

  • @tak68tak
    @tak68tak Pƙed rokem

    Thanks a lot. crystal clear.

  • @ChikoCordero
    @ChikoCordero Pƙed rokem

    Thanks!