vuejs / vuefire

🔥 Firebase bindings for Vue.js
https://vuefire.vuejs.org
MIT License
3.82k stars 323 forks source link

useFirestore() not defined on Nuxt API endpoints #1380

Closed michael-strain closed 12 months ago

michael-strain commented 1 year ago

Reproduction

This isn't a real reproduction, will my example below work instead? https://stackoverflow.com/questions/75968536/how-do-i-access-a-firestore-collection-in-a-nuxt-3-server-route-utilizing-vuefi

Steps to reproduce the bug

// 'server/api/example.post.js'
export default defineEventHandler(async(event) => {
  useFirestore().doc("collectionName/"+itemId).update({body})
})

Expected behavior

Ideally, I'd be able to interact with firestore (or specifically, firestore-admin) from within my API endpoints.

UPDATE Looks like the latest update should have taken care of all my problems here. Thank you posva and any others that worked on this latest release!