# @mchirico/fblog

> A Firebase logger

Latest version **1.1.1** (published 2020-07-22) · ISC license · 0 weekly downloads

## Install

```sh
npm install @mchirico/fblog
pnpm add @mchirico/fblog
yarn add @mchirico/fblog
bun add @mchirico/fblog
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2020-07-22 |
| First published | 2020-07-21 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 25.4 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Mike Chirico |
| Maintainers | mchirico |

## Links

- npm: https://www.npmjs.com/package/@mchirico/fblog
- Repository: https://github.com/mchirico/fblog
- Issues: https://github.com/mchirico/fblog/issues
- npm.io page: https://npm.io/package/@mchirico/fblog

## Dependencies (4)

- [rxjs](https://npm.io/package/rxjs.md) ^6.6.0
- [uuid](https://npm.io/package/uuid.md) ^8.2.0
- [@types/sinon](https://npm.io/package/@types/sinon.md) ^9.0.4
- [firebase-admin](https://npm.io/package/firebase-admin.md) ^9.0.0

## Recent versions

- 1.1.1 (latest) — 2020-07-22
- 1.0.18 — 2020-07-21
- 1.0.17 — 2020-07-21

## README

# fblog


## Usage

Save service account in file firebase-adminsdk.json in the directory credentials.

```
credentials/firebase-adminsdk.json
```

```
import {FBLog, App} from "@mchirico/fblog";

const databaseURL = "https://yourproject.firebaseio.com"
const db = App(databaseURL).firestore()
const fbLog = new FBLog(db);
const obs = fbLog.onSnapshot(
      "fblog",
      "action",
      "activate",
      "add",
      (doc: any) => {
        console.log("Document added...................callback:", doc?.desc);
      }
    );

// Eventually terminate the observable
obs();
```


In another program, maybe on another system

```
import {FBLog, App} from "@mchirico/fblog";

const databaseURL = "https://yourproject.firebaseio.com"
const db = App(databaseURL).firestore()
const fbLog = new FBLog(db);
fbLog.set("fblog",{desc: "description to log", action: "activate"})

```

---
_Source: https://npm.io/package/@mchirico/fblog · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
