firebase_functions
0.8.0, released 2 months ago by firebase.google.com
Define Cloud Functions for Firebase in Dart with support for the Admin SDK and Firestore.
What it does
Allows developers to write and deploy serverless Cloud Functions for Firebase using Dart. It integrates with the Firebase Admin SDK, Cloud Storage, and Firestore, handling requests and responses via Shelf.
AI-written summary of version 0.8.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You want to write your Firebase Cloud Functions in Dart instead of Node.js or Python
- You need to handle HTTPS triggers and HTTPS-based cloud endpoints in Dart
Skip it when
- You need production support for background triggers other than HTTPS triggers
- You are not using Firebase for your backend infrastructure
Strengths
- Enables full-stack Dart development including server-side cloud functions
- Integrates with the Firebase Admin SDK and Cloud Storage/Firestore
Weaknesses
- Background triggers outside of HTTPS are currently experimental
- Requires specific Firebase CLI and SDK constraints for native build hooks
Setup
- Kind
- Pure Dart
- Effort
- Medium
- Code generation
- Yes (build_runner)
- Direct dependencies
- 15
Requires configuring Firebase functions and matching SDK constraints, with specific firebase-tools requirements for deployment.
import 'package:firebase_functions/firebase_functions.dart';
void main(List<String> args) {
runFunctions((firebase) {
firebase.https.onRequest(
name: 'hello',
(request) async {
return Response.ok('Hello from Dart!');
},
);
});
}Alternatives
Packages that do the same job and could replace firebase_functions.
- cloud_firestore_web
The web implementation of cloud_firestore.
82Compare - cloud_functions_web
Web implementation of Firebase Cloud Functions for Flutter web apps
78Compare - cloud_functions
Flutter plugin for using the Cloud Functions for Firebase API.
96Compare - cloud_firestore
Flutter plugin for Cloud Firestore noSQL database with live synchronization.
98Compare
Works with
Packages commonly used together with firebase_functions: ones it builds on, ones built on it, and its own family.
- analyzerfirebase_functions depends on itPerforms static analysis of Dart code for tool integration and embedding.
- stack_tracefirebase_functions depends on itProvides parsing, inspection, and readable formatting of Dart stack traces.
- globfirebase_functions depends on itA file and directory globbing library that supports Bash-style path matching and listing.
- shelffirebase_functions depends on itComposable web server middleware for Dart
- yaml_editfirebase_functions depends on itYAML manipulation library preserving comments and whitespace
- buildfirebase_functions depends on itPackage for authoring build_runner compatible code generators.
- source_genfirebase_functions depends on itSource code generation builders and utilities for the Dart build system.
- protobuffirebase_functions depends on itProvides runtime support for Dart protocol buffer messages generated by protoc_plugin.