Skip to content
pubscout

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.

$ flutter pub add firebase_functions
Source repository

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.

Works with

Packages commonly used together with firebase_functions: ones it builds on, ones built on it, and its own family.