# firebasertdbconfigurationstore

> Simple application settings or document storage using your Firebase project's Realtime database

Latest version **1.0.6** (published 2018-07-26) · Apache-2.0 license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install firebasertdbconfigurationstore
pnpm add firebasertdbconfigurationstore
yarn add firebasertdbconfigurationstore
bun add firebasertdbconfigurationstore
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.6 |
| Published | 2018-07-26 |
| First published | 2018-07-25 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 18.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | FairVentures Lab |
| Maintainers | fvllam |

## Links

- npm: https://www.npmjs.com/package/firebasertdbconfigurationstore
- Repository: https://github.com/fvllam/firebaseRTDBConfigurationStore
- Homepage: https://github.com/fvllam/firebaseRTDBConfigurationStore#readme
- Issues: https://github.com/fvllam/firebaseRTDBConfigurationStore/issues
- npm.io page: https://npm.io/package/firebasertdbconfigurationstore

## Dependencies (1)

- [firebase-admin](https://npm.io/package/firebase-admin.md) ^5.13.1

## Recent versions

- 1.0.6 (latest) — 2018-07-26
- 1.0.5 — 2018-07-26
- 1.0.4 — 2018-07-26
- 1.0.3 — 2018-07-25
- 1.0.2 — 2018-07-25
- 1.0.1 — 2018-07-25
- 1.0.0 — 2018-07-25

## README

# firebaseRTDBConfigurationStore

Simple application settings or document storage using your Firebase project's Realtime Database. Global configurations will be stored under `/internal/global/` and user-specific configurations will be stored under `/internal/user/<userId>`.  The paths can be configured by passing optional arguments to the constructor.

# Prerequisite

This module should only be used within a Firebase project since it implicitly initializes the Firebase app to access the project's Firebase services.

# Usage

## Create and initialize the object.

```ts
const currentUserId = '1234';
const settings = new FirebaseRTDBConfigurationStore(currentUserId, '/custom/pathToGlobalConfig/', '/custom/pathToUserConfig');
return settings.init().then(() => {...});
```

## Retrieve values by key or get it's default value if a value doesn't exist for the key.

```ts
return settings.getGlobalData('someKey', 'default value')
.then(globalValue => ...);
```

```ts
return settings.getUserData('someOtherKey', 'default value')
.then(userValue => ...);
```

## Set the key-value pair.

```ts
return settings.setGlobalData('someKey', 'some value')
.then(globalValue => ...);
```

```ts
return settings.setUserData('someOtherKey', 'some value')
.then(userValue => ...);
```

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