Connect to Firestore DB using Admin SDK - Online store with Nuxt 3 & Firebase

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 พ.ย. 2024

ความคิดเห็น • 16

  • @maskman4821
    @maskman4821 2 ปีที่แล้ว +1

    This is very useful and practical tutorial 😍

  • @KazahMoyMuzh
    @KazahMoyMuzh 2 ปีที่แล้ว +1

    Thank you!

  • @michael-strain
    @michael-strain ปีที่แล้ว +1

    Do we really have to initialize the admin sdk on each endpoint using firestore? Is there a way that you know of to initialize once on the server and have endpoints use it?

    • @elilopezdev
      @elilopezdev  ปีที่แล้ว +1

      Hi, since this is not a regular Node.js server that's always on, you do need to check if you have to initialize admin SDK every time you call it. That's because Firebase Cloud Functions are stateless, meaning the execution environment is often initialized from scratch (this is called a cold start). If you stop using the function for a while, you'll see your endpoint takes longer to respond the first time you call it again because it's booting your function again.

  • @danielwatson6529
    @danielwatson6529 2 ปีที่แล้ว +1

    Awesome!, didn't expect to see it like that - ive learned allot today Thanks! At the end it says Authentication is next when is that ready?

    • @danielwatson6529
      @danielwatson6529 2 ปีที่แล้ว +1

      oh I think I found it in with the stripe subscriptions!!

    • @elilopezdev
      @elilopezdev  2 ปีที่แล้ว +1

      ​@@danielwatson6529 Yes! Glad it's helpful. Auth was tricky to do with Nuxt 3 and probably will change in the near future (because Beta), so I decided to continue with Vue 3 tutorials until Nuxt 3 gets more stable and packages like @nuxt/auth get updated

  • @lucasmordzin
    @lucasmordzin 2 ปีที่แล้ว +1

    Could you make a tutorial teaching how to deploy nuxt3 on firebase hosting?

  • @danielwatson6529
    @danielwatson6529 2 ปีที่แล้ว

    at 6:00 you say if you change a field in fire store we will see it on the front end. This is only true if I refresh, I was hoping for the same effect as unsubscribe/realtime listener, I can't seem to find anything on this other than putting it on the client side, which defeats the object I think

  • @0xiah
    @0xiah ปีที่แล้ว

    How do you use cert when deploying if the cert file is in git ignore?

  • @RyuuuGamingUnlimited
    @RyuuuGamingUnlimited 2 ปีที่แล้ว

    how do you deploy it in netlify if the service account key json is not included? I'm practicing nuxt 3 and I want to deploy my app in netlify.
    Thanks!

  • @csechuan
    @csechuan 2 ปีที่แล้ว +2

    Hey bro, what happen if use Firebase client SDK on nuxt3?

    • @elilopezdev
      @elilopezdev  2 ปีที่แล้ว +2

      It is posible, but that means you'd also have to use Firebase client side authentication later, making it harder to detect auth server-side. So things like auth server-side middlewares to redirect not authenticated users, and server side rendering in general becomes complicated.
      With this approach, you can handle Auth using Nuxt.js and then use the Admin SDK to bring info from Firestore.

  • @vinosamari
    @vinosamari 2 ปีที่แล้ว

    Hi Eli. I’m having issues using my realtime database in Nuxt. I can’t seem to listen for changes and populate an array with the changes accordingly. Any help will be greatly appreciated.

    • @danielwatson6529
      @danielwatson6529 2 ปีที่แล้ว

      im having the same issue, did you find a solution?

  • @shiryaev585
    @shiryaev585 6 หลายเดือนก่อน

    How do you set POST requests in such an app. For example,
    await useFetch('/api/products', {
    method: 'POST',
    body: someBody
    }).data;
    }
    I get 200 status code, but i don't see a new object in my collection
    Thanks!