Skip to content

Commit

Permalink
Fix firebase/app-check import
Browse files Browse the repository at this point in the history
  • Loading branch information
blindaa121 committed Dec 11, 2024
1 parent 8cb3ede commit f999c21
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/components/Applause/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import {
increment,
} from "firebase/firestore";
import { initializeApp } from "firebase/app";
const {
import {
initializeAppCheck,
ReCaptchaEnterpriseProvider,
} = require("firebase/app-check");
} from "firebase/app-check";
import { useLocation } from "@docusaurus/router";
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
import ExecutionEnvironment from "@docusaurus/ExecutionEnvironment";
Expand All @@ -31,6 +31,8 @@ function ApplauseButton() {
siteConfig: { customFields },
} = useDocusaurusContext();

console.log(customFields.recaptchaApiKey);

const firebaseConfig = {
apiKey: customFields.firebaseApiKey,
projectId: "pan-dev-f1b58",
Expand All @@ -48,10 +50,10 @@ function ApplauseButton() {

if (customFields.recaptchaApiKey && ExecutionEnvironment.canUseDOM) {
app = initializeApp(firebaseConfig);
// appCheck = initializeAppCheck(app, {
// provider: new ReCaptchaEnterpriseProvider(customFields.recaptchaApiKey),
// isTokenAutoRefreshEnabled: true,
// });
appCheck = initializeAppCheck(app, {
provider: new ReCaptchaEnterpriseProvider(customFields.recaptchaApiKey),
isTokenAutoRefreshEnabled: true,
});
db = getFirestore(app);
docRef = doc(db, COLLECTION_ID, docId);
}
Expand Down

0 comments on commit f999c21

Please sign in to comment.