Skip to content

useFirestore() not defined on Nuxt API endpoints #1380

@michael-strain

Description

@michael-strain

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions