All Projects → pulyaevskiy → Firebase Admin Interop

pulyaevskiy / Firebase Admin Interop

Licence: bsd-3-clause
Firebase Admin Interop Library for Dart

Programming Languages

dart
5743 projects
dartlang
94 projects

Projects that are alternatives of or similar to Firebase Admin Interop

Use Firebase Auth
A custom React Hook that provides a declarative interface for Firebase Auth.
Stars: ✭ 61 (-18.67%)
Mutual labels:  firebase
Instadart Flutter Instagram Clone
Instagram Clone App Using - Dart, Flutter, Firebase
Stars: ✭ 66 (-12%)
Mutual labels:  firebase
Firebase Stripe
Headless Stripe Payments Using Firebase Functions
Stars: ✭ 72 (-4%)
Mutual labels:  firebase
Flutter firebase vote
A flutter application named Vote, based on firebase auth and firestore database.
Stars: ✭ 62 (-17.33%)
Mutual labels:  firebase
Rgviperchat
An iOS chat app written following a VIPER architecture and BDD
Stars: ✭ 65 (-13.33%)
Mutual labels:  firebase
Pushraven
A simple Java library to interface with Firebase Cloud Messaging (FCM) API. Pushraven allows you to push notifications to clients in very few lines of code.
Stars: ✭ 67 (-10.67%)
Mutual labels:  firebase
Vuexfire Admin
A Vue / Vuexfire app with Firebase auth. Based on vue-admin, using vuex, vuexfire, vue-router and firebase as the backend.
Stars: ✭ 60 (-20%)
Mutual labels:  firebase
Experimental Extensions
🧪 A laboratory for new extensions created by Firebase
Stars: ✭ 73 (-2.67%)
Mutual labels:  firebase
Habito
Simple habit tracker app for Android
Stars: ✭ 65 (-13.33%)
Mutual labels:  firebase
The forge
Our groundbreaking, lightning fast PWA CLI tool
Stars: ✭ 70 (-6.67%)
Mutual labels:  firebase
Realmfire Swift
Sync a local realm database with firebase
Stars: ✭ 62 (-17.33%)
Mutual labels:  firebase
Firetable
Excel/Google Sheets like UI for Firebase/Firestore. No more admin portals!
Stars: ✭ 1,115 (+1386.67%)
Mutual labels:  firebase
Vsfire
Visual Studio Code extension for syntax highlighting, hover help and code completions with Firestore security rules and index definition files
Stars: ✭ 68 (-9.33%)
Mutual labels:  firebase
Drivety
Drivety: Smart App Assistant to Secure Inside Car Activity. #AndroidDevChallenge
Stars: ✭ 62 (-17.33%)
Mutual labels:  firebase
Angular Redux Ngrx Examples
Sample projects with Angular (4.x) + Angular CLI + ngrx (Redux) + Firebase
Stars: ✭ 73 (-2.67%)
Mutual labels:  firebase
Firebaserealtimechat
Sample real-time chat application using Firebase
Stars: ✭ 60 (-20%)
Mutual labels:  firebase
Firebaseauth Android
Firebase Authentication code guideline for Android developer
Stars: ✭ 67 (-10.67%)
Mutual labels:  firebase
Integrify
🤝 Enforce referential and data integrity in Cloud Firestore using triggers
Stars: ✭ 74 (-1.33%)
Mutual labels:  firebase
Vuejsfire Hackathon Starter
Hackathon starter kit based on vue.js and Firebase
Stars: ✭ 73 (-2.67%)
Mutual labels:  firebase
Mock Cloud Firestore
Mock library for Cloud Firestore
Stars: ✭ 69 (-8%)
Mutual labels:  firebase

Build Status

Write server-side Firebase applications in Dart using Node.js as a runtime.

Firestore Timestamps migration:

Firestore deprecated usage of DateTime objects in favor of custom Timestamp type and recommends migrating as soon as possible. By default all timestamps are still returned as DateTime objects and you can access them with DocumentData.getDateTime or DocumentData.setDateTime. To start using Timestamps you must configure Firestore as follows:

final app = FirebaseAdmin.instance.initializeApp();
final firestore = app.firestore();
// Call Firestore.settings at the very beginning before any other calls:
firestore.settings(FirestoreSettings(timestampsInSnapshots: true));
// You can read and write data now, but make sure to use new `setTimestamp` and `getTimestamp`
// methods of `DocumentData`.

Installation

  1. Add this package as a dependency to your pubspec.yaml:
dependencies:
  firebase_admin_interop: [latest_version]

Run pub get.

  1. Create package.json file to install Node.js modules used by this library:
{
  "dependencies": {
    "firebase-admin": "8.5.0",
    "@google-cloud/firestore": "2.0.0"
  }
}

Run npm install.

Usage

Below is a simple example of using Realtime Database client:

import 'dart:async';
import 'package:firebase_admin_interop/firebase_admin_interop.dart';

Future<void> main() async {
  final serviceAccountKeyFilename = '/absolute/path/to/service-account.json';
  final admin = FirebaseAdmin.instance;
  final cert = admin.certFromPath(serviceAccountKeyFilename);
  final app = admin.initializeApp(new AppOptions(
    credential: cert,
    databaseURL: "YOUR_DB_URL",
  ));
  final ref = app.database().ref('/test-path');
  // Write value to the database at "/test-path" location.
  await ref.setValue("Hello world");
  // Read value from the same database location.
  var snapshot = await ref.once("value");
  print(snapshot.val()); // prints "Hello world".
}

Note that it is only possible to use JSON-compatible values when reading and writing data to the Realtime Database. This includes all primitive types (int, double, bool), string values (String) as well as any List or Map instance.

For Firestore there are a few more supported data types, like DateTime and GeoPoint.

Building

This library depends on node_interop package which provides Node.js bindings and build_node_compilers package which allows compiling Dart applications as Node.js modules.

To enable builders provided by build_node_compilers first add following dev dependencies to your pubspec.yaml:

dev_dependencies:
  build_runner: ^1.0.0
  build_node_compilers: ^0.2.0

Next, create build.yaml file with following contents:

targets:
  $default:
    sources:
      - "lib/**"
      - "node/**" # Assuming your main Dart files is in node/ folder (recommended).
      - "test/**"
    builders:
      build_node_compilers|entrypoint:
        options:
          compiler: dart2js # To compile with dart2js by default

You can now build your project using build_runner:

# By default compiles with DDC
pub run build_runner build --output=build

# To compile with dart2js:
pub run build_runner build \
  --define="build_node_compilers|entrypoint=compiler=dart2js" \
  --define="build_node_compilers|entrypoint=dart2js_args=[\"--minify\"]" \ # optional, minifies resulting code
  --output=build/

Status

This library is considered stable though not feature complete. It is recommended to check dev versions for latest updates and bug fixes.

Make sure to checkout CHANGELOG.md after every release, all notable changes and upgrade instructions will be described there.

Current implementation coverage report:

  • [x] admin
  • [x] admin.auth
  • [x] admin.app
  • [x] admin.credential
  • [x] admin.database
  • [x] admin.firestore
  • [x] admin.messaging
  • [ ] admin.storage

Features and bugs

Please file feature requests and bugs at the issue tracker.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].