Skip to content

Commit 4194b42

Browse files
author
Athira M
committed
prepare for testing
1 parent 7a34020 commit 4194b42

File tree

2 files changed

+13
-21
lines changed

2 files changed

+13
-21
lines changed

web-exp-bugbash/my-app/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"start": "next start"
99
},
1010
"dependencies": {
11+
"firebase": "^12.4.0",
1112
"next": "15.5.4",
1213
"react": "19.1.0",
1314
"react-dom": "19.1.0"

web-exp-bugbash/my-app/src/app/page.tsx

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
import { useEffect, useState } from "react";
44
import { initializeApp } from "firebase/app";
5-
import { getRemoteConfig, fetchAndActivate, getAll, setCustomSignals, getString } from "firebase/remote-config";
5+
import { getRemoteConfig, fetchAndActivate, getString } from "firebase/remote-config";
66
import { getInstallations } from "firebase/installations";
7-
import { getAnalytics, logEvent } from "firebase/analytics";
7+
import { getAnalytics } from "firebase/analytics";
88

9-
function Screen({isLoading, summary} = {isLoading: false, summary: ""}) {
9+
function Screen({ isLoading, rollout, abt } = { isLoading: false, rollout: "", abt: "" }) {
1010
if (isLoading) {
11-
return (<div>Loading...</div>)
11+
return (<div>Loading...</div>)
1212
}
1313
return (
1414
<div>
@@ -17,8 +17,9 @@ function Screen({isLoading, summary} = {isLoading: false, summary: ""}) {
1717
</div>
1818
<br></br>
1919
<div>
20-
Blurred Summary: {summary}
20+
Rollout value: {rollout}
2121
<br></br>
22+
ABT value: {abt}
2223
</div>
2324
</div>
2425
)
@@ -28,16 +29,7 @@ export default function Home() {
2829

2930
useEffect(() => {
3031
const firebaseConfig = {
31-
apiKey: process.env.NEXT_PUBLIC_API_KEY,
32-
authDomain: "rc-test-123.firebaseapp.com",
33-
databaseURL: "https://rc-test-123-default-rtdb.asia-southeast1.firebasedatabase.app",
34-
projectId: "rc-test-123",
35-
storageBucket: "rc-test-123.firebasestorage.app",
36-
messagingSenderId: "985821706564",
37-
appId: "1:985821706564:web:56b260fbd62e4ad09a7f11",
38-
measurementId: "G-96PZ0KC1WS"
3932
};
40-
4133
console.log(process.env.API_KEY);
4234

4335
const app = initializeApp(firebaseConfig);
@@ -46,21 +38,20 @@ export default function Home() {
4638
config.settings.minimumFetchIntervalMillis = 0;
4739

4840
const installations = getInstallations(app);
49-
50-
setCustomSignals(config, {'test_signal': 'test'});
5141

5242
fetchAndActivate(config).then(success => {
53-
console.log(success, getAll(config));
5443
setIsLoading(false);
55-
setBlurredSummary(getString(config, 'show_blurred_summary'));
56-
logEvent(analytics, "test-event");
44+
setRolloutValue(getString(config, 'web_param_rollout'));
45+
setAbtValue(getString(config, 'web_param_abt'));
5746
});
5847
});
5948

6049
const [isLoading, setIsLoading] = useState(true);
61-
const [showBlurredSummary, setBlurredSummary] = useState("blurredSummary");
50+
const [showRolloutValue, setRolloutValue] = useState("rolloutValue");
51+
const [showAbtValue, setAbtValue] = useState("abtValue");
52+
6253

6354
return (
64-
<Screen isLoading={isLoading} summary={showBlurredSummary}></Screen>
55+
<Screen isLoading={isLoading} rollout={showRolloutValue} abt={showAbtValue}></Screen>
6556
);
6657
}

0 commit comments

Comments
 (0)