const { onCall, HttpsError } = require("firebase-functions/v2/https");
exports.getQuestion = onCall((request) => {
if (!request.auth) {
throw new HttpsError(
"unauthenticated",
"You must be authenticated to access this resource."
);
}
const { key1, key2 } = request.data;
// or
// const data = request.data;
});
For more refer