I am currently utilizing a package called next-firebase-auth. I am encountering an issue when calling getFirebaseAdmin
from next-firebase-auth and attempting to use it, specifically when using db as a reference in doc(db)
.
The error message received is: "Argument of type 'Firestore' is not assignable to parameter of type 'DocumentReference'. Type 'Firestore' is missing the following properties from type 'DocumentReference': converter, type, firestore, id, and 3 more."
API
import { doc, getDoc } from "firebase/firestore";
import { getFirebaseAdmin } from "next-firebase-auth";
import type { NextApiRequest, NextApiResponse } from "next";
export const getUserInfo = (req: NextApiRequest, res: NextApiResponse) => {
const db = getFirebaseAdmin().firestore();
const docRef = doc(db, "user", "SF");
return res.status(200).json({ data: "hello" });
};
Question: Do I need to utilize init?