fiber-firebase-functions
v1.0.7
Published
A collection of ready-to-use Firebase Cloud Functions utilities and wrappers designed for any application built by Fiber. Provides reusable helpers, common patterns, and production-grade modules to streamline backend development across all Fiber projects.
Maintainers
Readme
fiber-firebase-functions
A collection of ready-to-use Firebase Cloud Functions utilities and wrappers designed for any application built by Fiber. Provides reusable helpers, common patterns, and production-grade modules to streamline backend development across all Fiber projects.
Installation
Install the package using one of the following commands:
npm i fiber-firebase-functionsConfiguration
After installing the package, the first required step is to create an app.json file at the root of your Cloud Functions project.
This file contains all configuration values needed by the package and is automatically loaded at runtime.
Your project structure should look like:
functions/
├─ src/
├─ package.json
├─ app.json ← required configuration fileYou can then define your configuration keys inside app.json.
Examples are provided below.
If you plan to use the functions:
- isRateLimited
- recordRateLimitHit
- ResetPassword.withEmail
- ResetPassword.withId
You must provide a middleware configuration inside your app.json.
This middleware is used internally by the package to apply rate-limiting logic and return the appropriate response when a user performs too many requests.
Here is the minimal required configuration:
{
"rate_limiter": {
"app_name": "rateLimiter",
"url": "https://database.com"
}
}Make sure the url points to your Realtime Database instance and that the app_name matches your internal configuration.
If you want to enable email sending through this package, you must first install and configure the Trigger Email From Firestore extension.
Once the extension is set up, you need to define an email section in your app.json.
Here is the required configuration:
{
"email": {
"application_name": "MyFiber",
"collection": "__fbs__email"
}
}The application_name corresponds to the name of your application, and the collection must match the Firestore collection monitored by the extension.
