FLUTTER ECOSYSTEM

appsup-dart/firebase_admin

Firebase Admin SDK の純粋な Dart 実装

firebase_admin のプロジェクト画像
Stars
46
Forks
50
最終プッシュ(UTC)
2026/04/11
プロジェクト状態
公開中
appsup-dart GitHub avatar
GITHUB Organization

appsup-dart ↗

言語Dart

技術トピック

このリポジトリが公開するパッケージ

使用している依存関係

依存関係一覧 21 件

元の README

以下は英語原文のスナップショットです。最新版は GitHub をご覧ください。

README を開く / 閉じる

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.