On the same note of gcloud functions commands defaulting to 2nd Gen functions, Firebase Functions SDK will change default entrypoint of the SDK to point to the v2 namespace in the next major release.
Before:
const functions = require('firebase-functions');
// This is a v1 callable function
exports.v1 = functions.https.onCall((data, context) => {
// ...
});
After:
const functions = require('firebase-functions');
// This is a v2 callable function
exports.v2 = functions.https.onCall((req) => {
// ...
});
// Preferred style
const { onCall } = require('firebase-functions/https');
// This is a v2 callable function
exports.v2 = onCall((req) => {
// ...
});
On the same note of
gcloud functions
commands defaulting to 2nd Gen functions, Firebase Functions SDK will change default entrypoint of the SDK to point to the v2 namespace in the next major release.Before:
After: