Skip to content

Instantly share code, notes, and snippets.

@ben-hamel
Created February 19, 2022 01:00
Show Gist options
  • Save ben-hamel/10fea72e1a07974d51a7a8ad51ed326e to your computer and use it in GitHub Desktop.
Save ben-hamel/10fea72e1a07974d51a7a8ad51ed326e to your computer and use it in GitHub Desktop.
Firebase V9 config file + getAuth: for use with Expo managed React Native app using Firebase JS SDK
import { initializeApp } from "firebase/app";
import { getAuth } from "firebase/auth";
import Constants from "expo-constants";
// Initialize Firebase
const firebaseConfig = {
apiKey: Constants.manifest.extra.apiKey,
authDomain: Constants.manifest.extra.authDomain,
projectId: Constants.manifest.extra.projectId,
storageBucket: Constants.manifest.extra.storageBucket,
messagingSenderId: Constants.manifest.extra.messagingSenderId,
appId: Constants.manifest.extra.appId,
};
// initialize firebase
initializeApp(firebaseConfig);
// initialize auth
const auth = getAuth();
export { auth };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment