Firebase Setup Add the Firebase SDKs to your server and frontend app

This lesson is available for PRO members or as a single course purchase. Sign-in and choose a plan below.

*Enrollment provides full access to this course (and updates) for life.

Or Signup for Unlimited PRO Access

Learn more about Firestore.

Server Firebase Admin Setup

command line
npm install firebase-admin

Download your service account, then add add it’s path as an environment variable.

file_type_config .env

file_type_typescript firebase.ts
// Initialize Firebase Admin resources

import * as firebaseAdmin from 'firebase-admin';

export const db = firebaseAdmin.firestore();
export const auth = firebaseAdmin.auth();

React Firebase Setup

command line
npm install firebase reactfire
import { FirebaseAppProvider } from 'reactfire';

export const firebaseConfig = {
    // your config

    <FirebaseAppProvider firebaseConfig={firebaseConfig}>
      <Elements stripe={stripePromise}>
        <App />

Q&A Chat