@inpassor/firebase-config
Firebase Remote Config library
Last updated 2 months ago by inpassor .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @inpassor/firebase-config 
SYNC missed versions from official npm registry.

Firebase Remote Config library

This library used for interaction with Firebase Remote Config REST API to set or get Remote Config values in Node.js environment.

Dependacies

google-auth-library

The library uses google-auth-library npm package and provides a variety of ways to authenticate Remote Config API requests:

  • Provide a keyId and key of your Firebase project.
  • Provide a private key file for your Firebase service account.
  • Provide GOOGLE_APPLICATION_CREDENTIALS environment variable.
  • Use none of above in case of usage of the library on Google Cloud.

Read about Google Cloud API authentication at Getting Started with Authentication

node-cache

The library uses node-cache npm package for storing ETag value.

See cacheOptions config option.

flat

The library uses flat npm package for flatten and unflatten Remote Config parameters.

See delimiter config option.

Example

import * as path from 'path';
import {
    FirebaseConfig,
    DataObject,
} from '@inpassor/firebase-config';

/**
 * Instantiate FirebaseConfig
 */
const firebaseConfig = new FirebaseConfig({
    projectId: 'my-awesome-project-id',
    keyFileName: path.resolve('path', 'to', 'my-awesome-project-service-key.json'),
    // key: 'my-project-key',
    // keyId: 'my-project-key-id',
    // cacheOptions: {
    //     forceString?: boolean;
    //     objectValueSize?: number;
    //     arrayValueSize?: number;
    //     stdTTL?: number;
    //     checkperiod?: number;
    //     useClones?: boolean;
    //     errorOnMissing?: boolean;
    //     deleteOnExpire?: boolean;
    // },
    // delimiter: '___',
    // defaultErrorMessage: 'Invalid response from the Firebase Remote Config service',
});

/**
 * Set Remote Config 
 */
firebaseConfig.set({
    // [key: string]: any
}).then(
    () => console.log('published'),
    (error: any) => console.error(error),
);

/**
 * Get Remote Config 
 */
firebaseConfig.get().then(
    (parameters: DataObject) => console.log(parameters),
    (error: any) => console.error(error),
);

Current Tags

  • 1.2.1                                ...           latest (2 months ago)

11 Versions

  • 1.2.1                                ...           2 months ago
  • 1.2.0                                ...           5 months ago
  • 1.1.1                                ...           5 months ago
  • 1.1.0                                ...           5 months ago
  • 1.0.1                                ...           5 months ago
  • 1.0.0                                ...           6 months ago
  • 0.2.7 [deprecated]           ...           8 months ago
  • 0.2.5 [deprecated]           ...           8 months ago
  • 0.2.3 [deprecated]           ...           8 months ago
  • 0.2.2 [deprecated]           ...           9 months ago
  • 0.2.1 [deprecated]           ...           9 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 35
Last Day 0
Last Week 23
Last Month 13
Dependencies (3)
Dev Dependencies (4)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |