* stage 1: project init * stage 2: skeleton with navigation * step 2.5: streams list * step 4: stream playback experience * step 5-6: compose experience * fix: broken record * transcode media particles to mp4 * build: reproducible go generate * build: rename skaffold module for particle processor worker * infra: increase particle processor worker resources Was dealing with OOM errors * tweaks to mobile * log transcode work * view on desktop placeholder * tweak padding * cap video resolution to save on memory * infra: bump memory limits as insurance * ux improvements * update bundle id for mobile * config for mobile
31 lines
1.4 KiB
TypeScript
31 lines
1.4 KiB
TypeScript
import { initializeApp } from "firebase/app";
|
|
import {
|
|
initializeAuth,
|
|
// `getReactNativePersistence` is documented Firebase RN setup but Firebase
|
|
// intentionally omits it from `firebase/auth`'s public type bundle (it
|
|
// would pollute web autocomplete). The runtime export exists on every
|
|
// platform; this is the workaround the Firebase docs themselves use.
|
|
// @ts-expect-error — RN-only symbol missing from public Firebase types.
|
|
getReactNativePersistence,
|
|
} from "firebase/auth";
|
|
import { initializeFirestore } from "firebase/firestore";
|
|
import AsyncStorage from "@react-native-async-storage/async-storage";
|
|
import { appConfig } from "@/config/env";
|
|
|
|
export const firebaseApp = initializeApp(appConfig.firebase);
|
|
|
|
// AsyncStorage persists the Firebase auth token across cold starts. Without
|
|
// it, the user would have to re-sign-in to Firestore every launch even though
|
|
// the Orion bearer token is in SecureStore.
|
|
export const firebaseAuth = initializeAuth(firebaseApp, {
|
|
persistence: getReactNativePersistence(AsyncStorage),
|
|
});
|
|
|
|
// Firestore's default WebChannel transport often fails on cellular networks
|
|
// and behind aggressive proxies on iOS. Long-polling is the documented
|
|
// remedy for React Native and is also what the Firebase team recommends
|
|
// for mobile apps using the JS SDK.
|
|
export const firestoreDb = initializeFirestore(firebaseApp, {
|
|
experimentalAutoDetectLongPolling: true,
|
|
});
|