Search packages, repositories and app categories

Package detailsv0.3.1+5

firebase_admin

A port of the Firebase admin sdk to pure, idiomatic Dart code

AndroidiOSmacOSWindowsLinux
30-day downloads
1.2K
Likes
98
Pub points
150

Install package

flutter pub add firebase_admin

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

The firebase_admin package provides a pure, idiomatic Dart implementation of the Firebase Admin SDK, enabling server-side interactions with Firebase services. It allows developers to authenticate users, manage Firebase projects, and perform administrative tasks such as user management, token verification, and database operations from Dart-based backends. Designed for use in non-browser environments like servers, CLI tools, or desktop apps, it supports all major platforms including Android, iOS, macOS, Windows, and Linux. The package is ideal for integrating Firebase functionality into custom backend systems without relying on JavaScript or external dependencies.

Use cases

  • Server-side Firebase administration
  • User management via Firebase Auth
  • Token validation and verification
  • Backend integration with Firebase Firestore
  • Automated Firebase project setup

Key features

  • Pure Dart implementation
  • Cross-platform support
  • Idiomatic Dart API
  • Secure Firebase Admin access
  • Supports all Firebase services

Suitable for

  • Backend developers using Dart
  • Serverless functions with Firebase
  • Desktop applications needing Firebase access
  • Custom authentication systems
  • CI/CD pipelines requiring Firebase automation

Considerations

  • Requires service account credentials
  • Not suitable for client-side apps
  • Needs secure handling of private keys
  • Limited to admin-level operations
  • Platform-specific configuration may be needed

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

Ceasefire Now

A pure Dart implementation of the Firebase admin sdk

Currently, only supports admin methods for the following firebase services:

  • authentication
  • realtime database

Example using service account

import 'package:firebase_admin/firebase_admin.dart';

main() async {
  var app = FirebaseAdmin.instance.initializeApp(AppOptions(
    credential: ServiceAccountCredential('service-account.json'),
  ));

  var link = await app.auth().generateSignInWithEmailLink('jane@doe.com',
      ActionCodeSettings(url: 'https://example.com'));

  print(link);
}

Example using default credentials

import 'package:firebase_admin/firebase_admin.dart';
import 'package:firebase_admin/src/credential.dart';

void main() async {
  // applicationDefault() will look for credentials in the following locations:
  // * the env variable GOOGLE_APPLICATION_CREDENTIALS
  // * a configuration file, specific for this library, stored in the user's home directory
  // * gcloud's application default credentials
  // * credentials from the firebase tools
  var credential = Credentials.applicationDefault();

  // when no credentials found, login using openid
  // the credentials are stored on disk for later use
  credential ??= await Credentials.login();

  // create an app
  var app = FirebaseAdmin.instance.initializeApp(AppOptions(
      credential: credential ?? Credentials.applicationDefault(),
      projectId: 'some-project'));

  try {
    // get a user by email
    var v = await app.auth().getUserByEmail('jane@doe.com');
    print(v.toJson());
  } on FirebaseException catch (e) {
    print(e.message);
  }
}

Features and bugs

Please file feature requests and bugs at the issue tracker.

Sponsor

Creating and maintaining this package takes a lot of time. If you like the result, please consider to :heart: sponsor. With your support, I will be able to further improve and support this project. Also, check out my other dart packages at pub.dev.

Categories

Dependencies

Dependency list 16 items

Source repository

Projects using this package