{"size": 1358, "ext": "js", "max_stars_repo_path": "src/data/firebase.js", "max_stars_repo_name": "markanator/rosemary-personal-finance", "max_stars_repo_stars_event_min_datetime": "2021-04-06T19:44:21.000Z", "max_stars_repo_stars_event_max_datetime": "2021-04-06T19:44:21.000Z", "max_issues_repo_path": "src/data/firebase.js", "max_issues_repo_name": "markanator/rosemary-personal-finance", "max_issues_repo_issues_event_min_datetime": "2021-03-16T19:19:25.000Z", "max_issues_repo_issues_event_max_datetime": "2021-05-10T22:14:08.000Z", "max_forks_repo_path": "src/data/firebase.js", "max_forks_repo_name": "markanator/rosemary-personal-finance", "max_forks_repo_forks_event_min_datetime": "2021-05-11T19:54:35.000Z", "max_forks_repo_forks_event_max_datetime": "2021-05-11T19:54:35.000Z"}
{"max_stars_count": 1, "max_issues_count": 36, "max_forks_count": 1, "avg_line_length": 33.95, "max_line_length": 68, "alphanum_fraction": 0.7820324006}
/* eslint-disable no-undef */
// Brings in the core functionality:
import firebase from 'firebase/app';

// Brings in the specific services we want to use:
import 'firebase/firestore';
import 'firebase/auth';

const firebaseConfig = {
  apiKey: process.env.REACT_APP_FIREBASE_KEY,
  authDomain: process.env.REACT_APP_AUTH_DOMAIN,
  projectId: process.env.REACT_APP_PROJECT_ID,
  storageBucket: process.env.REACT_APP_BUCKET,
  messagingSenderId: process.env.REACT_APP_MESSAGING_ID,
  appId: process.env.REACT_APP_APP_ID,
};

if (!firebaseConfig.apiKey)
  throw new Error('Missing firebase credential: apiKey');
if (!firebaseConfig.authDomain)
  throw new Error('Missing firebase credential: authDomain');
if (!firebaseConfig.projectId)
  throw new Error('Missing firebase credential: projectId');
if (!firebaseConfig.storageBucket)
  throw new Error('Missing firebase credential: storageBucket');
if (!firebaseConfig.messagingSenderId)
  throw new Error('Missing firebase credential: messagingSenderId');
if (!firebaseConfig.appId)
  throw new Error('Missing firebase credential: appId');

firebase.initializeApp(firebaseConfig);

const db = firebase.firestore();
const auth = firebase.auth();
const provider = new firebase.auth.GoogleAuthProvider();

const usersCollection = db.collection('users');

export { db, auth, provider, usersCollection, firebase };
