firebase / firebase-functions

Firebase SDK for Cloud Functions
https://firebase.google.com/docs/functions/
MIT License
1.01k stars 202 forks source link

Add startup lifecycle hook #1531

Closed inlined closed 3 months ago

inlined commented 3 months ago

Adds a new function that can be used at global scope to perform initialization in production that won't be called during discovery. In this function, params will be guaranteed to have actual values.

Usage:

const apiKey = params.defineSecret("API_KEY");

onInit(() => {
  someSDK.init(apiKey.value);
});