initialize-firebase-app
v1.1.0
Published
Initialize a firebase app (web or admin) with duplicate app error ignore
Downloads
79
Readme
initialize-firebase-app
Initialize firebase module (web, react-native or admin) using the appropriate credentials.
Installation
yarn add initialize-firebase-app
Usage
Client
import { initializeFirebaseApp } from "initialize-firebase-app";
export interface InitializeAppArgsClient {
authDomain?: string;
apiKey?: string;
databaseURL?: string;
firebase: any;
projectId?: string;
messagingSenderId?: string;
storageBucket?: string;
}
initializeFirebaseApp(config);
Server
import { initializeFirebaseApp } from "initialize-firebase-app";
export type FirebaseCredential = {
type: string;
project_id: string;
private_key_id: string;
private_key: string;
client_email: string;
client_id: string;
auth_uri: string;
token_uri: string;
auth_provider_x509_cert_url: string;
};
export interface InitializeAppArgsServer {
firebase: any;
databaseURL: string;
credential: FirebaseCredential;
}
initializeFirebaseApp(config);