Protect OpenAI key using Firebase function
I have an app that uses OpenAI and like many others my key was recently compromised. I have this simple code: const functions = require('firebase-functions'); const OpenAI = require("openai"); const openai = new OpenAI({ apiKey: functions.config().openai.key, }); exports.generateText = functions.https.onCall(async…