I can not for the life of me figure out why this is complaining. I was able to make an onCall function just fine (removed it here)... but when I make a firebase auth onCreate function, the get the error beow. What am I doing wrong?
This is the only code I have in my index.js right now.
Code:
import { onRequest, onCall } from 'firebase-functions/v2/https';
import { onDocumentCreated } from 'firebase-functions/v2/firestore';
import { initializeApp } from 'firebase-admin/app';
import { getFirestore } from 'firebase-admin/firestore';
import * as functions from 'firebase-functions';
initializeApp();
const db = getFirestore();
export const sendWelcomeEmail = functions.auth.user().onCreate((user) => {
console.log("123")
});
Error:
TypeError: Cannot read properties of undefined (reading 'user')
import * as functions from 'firebase-functions/v1';since auth.onCreate isn't yet supported by the v2 APIs. The other imports v2 you're showing are not relevant for an auth.onCreate type function, and if you're not using them, they should be removed.