Skip to content

Commit

Permalink
Add Firebase Performance Monitoring
Browse files Browse the repository at this point in the history
  • Loading branch information
richford committed Feb 10, 2024
1 parent cdf49c4 commit 34998c1
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
8 changes: 7 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"dot-object": "^2.1.4",
"firebase": "^9.23.0",
"lodash": "^4.17.21",
"vue": "^3.3.4"
"vue": "^3.3.4",
"web-vitals": "^3.4.0"
}
}
2 changes: 2 additions & 0 deletions src/firestore/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { FirebaseApp } from 'firebase/app';
import { Auth, User } from 'firebase/auth';
import { DocumentData, Firestore, Timestamp } from 'firebase/firestore';
import { Functions } from 'firebase/functions';
import { FirebasePerformance } from 'firebase/performance';
import { FirebaseConfigData } from './util';

export interface IRoarConfigData {
Expand All @@ -14,6 +15,7 @@ export interface IFirekit {
db: Firestore;
auth: Auth;
functions: Functions;
perf?: FirebasePerformance;
user?: User;
claimsLastUpdated?: Date;
}
Expand Down
2 changes: 2 additions & 0 deletions src/firestore/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
} from 'firebase/auth';
import { connectFirestoreEmulator, Firestore, getFirestore } from 'firebase/firestore';
import { Functions, connectFunctionsEmulator, getFunctions } from 'firebase/functions';
import { getPerformance } from 'firebase/performance';
import _chunk from 'lodash/chunk';
import _difference from 'lodash/difference';
import _flatten from 'lodash/flatten';
Expand Down Expand Up @@ -162,6 +163,7 @@ export const initializeFirebaseProject = async (
auth: optionallyMarkRaw('auth', getAuth(app)),
db: optionallyMarkRaw('db', getFirestore(app)),
functions: optionallyMarkRaw('functions', getFunctions(app)),
perf: getPerformance(app),
};

// Auth state persistence is set with ``setPersistence`` and specifies how a
Expand Down

0 comments on commit 34998c1

Please sign in to comment.