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?
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 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
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
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.
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.
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!
This is very useful and practical tutorial 😍
Thank you!
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?
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.
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?
oh I think I found it in with the stripe subscriptions!!
@@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
Could you make a tutorial teaching how to deploy nuxt3 on firebase hosting?
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
How do you use cert when deploying if the cert file is in git ignore?
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!
Hey bro, what happen if use Firebase client SDK on nuxt3?
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.
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.
im having the same issue, did you find a solution?
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!