abstracted-client
Helpful abstraction on the Firebase client API
Last updated 6 months ago by ksnyde .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install abstracted-client 
SYNC missed versions from official npm registry.

Build Status Coverage Status MIT license

A minimal abstraction over the Firebase client API

Basic Usage

Meant for frontend Javascript/Typescript apps which interact with Firebase's client API using the firebase client api.

import DB, { IFirebaseConfig } from "abstracted-client";
const config: IFirebaseClientConfig = {
  apiKey: "ATzaSyDuimhvBmcV1zeTl4m1MphOgWnzS16QhBM",
  authDomain: "my-app.firebaseapp.com",
  databaseURL: "https://my-app.firebaseio.com",
  projectId: "my-app",
  storageBucket: "my-app.appspot.com",
  messagingSenderId: "999999999999"
};
const db = new DB({ config });
// Get a list of records
const users = await db.getValue<IUser[]>("users");
// Push a new value onto a list
const company: ICompany = {
  name: "Acme",
  employees: 500
};
db.push<ICompany>("/companies", company);

Authentication

All of the authentication is done via the normal Firebase API for Auth which is accessible as auth off the DB class:

const db = new DB({ config });
const auth = db.auth;

Mocking

This library supports simple redirecting of all operations to the firemock mocking library; see related projects) and the "Mocking" section of the docs here for more details. In cases where mocking is being used, authentication (and security rights for paths) are not supported and therefore the above ENV variables are not required.

Documentation

Since this library and abstracted-admin share a common implementation for most of their API surface you'll find the documentation here: abstracted-admin

Current Tags

  • 0.38.3                                ...           latest (6 months ago)

79 Versions

  • 0.38.3                                ...           6 months ago
  • 0.38.2                                ...           6 months ago
  • 0.38.1                                ...           6 months ago
  • 0.38.0                                ...           6 months ago
  • 0.37.1                                ...           7 months ago
  • 0.37.0                                ...           8 months ago
  • 0.36.1                                ...           10 months ago
  • 0.36.0                                ...           10 months ago
  • 0.35.6                                ...           10 months ago
  • 0.35.5                                ...           10 months ago
  • 0.35.4                                ...           10 months ago
  • 0.35.3                                ...           a year ago
  • 0.35.2                                ...           a year ago
  • 0.35.1                                ...           a year ago
  • 0.35.0                                ...           a year ago
  • 0.34.0                                ...           a year ago
  • 0.33.1                                ...           a year ago
  • 0.33.0                                ...           a year ago
  • 0.32.3                                ...           a year ago
  • 0.32.2                                ...           a year ago
  • 0.32.1                                ...           a year ago
  • 0.32.0                                ...           a year ago
  • 0.30.3                                ...           a year ago
  • 0.30.1                                ...           a year ago
  • 0.30.0                                ...           a year ago
  • 0.27.8                                ...           a year ago
  • 0.27.7                                ...           a year ago
  • 0.27.6                                ...           a year ago
  • 0.27.5                                ...           a year ago
  • 0.27.4                                ...           a year ago
  • 0.27.3                                ...           a year ago
  • 0.27.2                                ...           a year ago
  • 0.27.1                                ...           a year ago
  • 0.27.0                                ...           a year ago
  • 0.26.0                                ...           a year ago
  • 0.25.2                                ...           a year ago
  • 0.25.1                                ...           a year ago
  • 0.25.0                                ...           a year ago
  • 0.17.0                                ...           2 years ago
  • 0.16.5                                ...           2 years ago
  • 0.16.4                                ...           2 years ago
  • 0.16.3                                ...           2 years ago
  • 0.16.2                                ...           2 years ago
  • 0.16.1                                ...           2 years ago
  • 0.16.0                                ...           2 years ago
  • 0.15.13                                ...           2 years ago
  • 0.15.10                                ...           2 years ago
  • 0.15.9                                ...           2 years ago
  • 0.15.7                                ...           2 years ago
  • 0.15.5                                ...           2 years ago
  • 0.15.4                                ...           2 years ago
  • 0.15.3                                ...           2 years ago
  • 0.15.2                                ...           2 years ago
  • 0.15.1                                ...           2 years ago
  • 0.14.17                                ...           2 years ago
  • 0.14.16                                ...           2 years ago
  • 0.14.5                                ...           2 years ago
  • 0.14.4                                ...           2 years ago
  • 0.14.3                                ...           2 years ago
  • 0.14.2                                ...           2 years ago
  • 0.14.1                                ...           2 years ago
  • 0.14.0                                ...           2 years ago
  • 0.12.3                                ...           2 years ago
  • 0.12.2                                ...           2 years ago
  • 0.12.1                                ...           2 years ago
  • 0.12.0                                ...           2 years ago
  • 0.10.9                                ...           2 years ago
  • 0.10.8                                ...           2 years ago
  • 0.10.7                                ...           2 years ago
  • 0.10.6                                ...           2 years ago
  • 0.10.5                                ...           2 years ago
  • 0.10.4                                ...           2 years ago
  • 0.10.3                                ...           2 years ago
  • 0.10.2                                ...           2 years ago
  • 0.10.1                                ...           2 years ago
  • 0.10.0                                ...           2 years ago
  • 0.9.0                                ...           3 years ago
  • 0.7.2                                ...           3 years ago
  • 0.7.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 2
Last Day 0
Last Week 1
Last Month 0
Dev Dependencies (20)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |