Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 12111

How to use Firebase App Check in React. 403 error

$
0
0

I want to use Firebase App Check in Gatsby Project.I have completed the App registration in the Firebase console.

enter image description here

In my project:

import { initializeApp } from "firebase/app";import { initializeAppCheck, ReCaptchaV3Provider, getToken } from "firebase/app-check";const app = initializeApp({  // My firebase configuration object});const appCheck = initializeAppCheck(app, {  provider: new ReCaptchaV3Provider('MY_RECAPTCHA_PUBLIC_KEY'),  isTokenAutoRefreshEnabled: true});getToken(appCheck)  .then(() => {    console.log('success')  })  .catch((error) => {    console.log(error.message)  })

But, it not working and got the error:

@firebase/app-check: FirebaseError: AppCheck: Fetch server returned an HTTP error status. HTTP status: 403. (appCheck/fetch-status-error).

So, can anyone help me check where the problem is? How to solve?

Thanks!


Viewing all articles
Browse latest Browse all 12111

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>