Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReCaptchaV3Provider Typescript #5258

Closed
zifahm opened this issue Aug 9, 2021 · 3 comments · Fixed by #5261
Closed

ReCaptchaV3Provider Typescript #5258

zifahm opened this issue Aug 9, 2021 · 3 comments · Fixed by #5261
Assignees

Comments

@zifahm
Copy link

zifahm commented Aug 9, 2021

Version 8.9.0


firebase
  .appCheck()
  .activate(
    new firebase.appCheck.ReCaptchaV3Provider(
      process.env.REACT_APP_RECAPTCHA_KEY
    ),
    true
  );

ts error: Argument of type 'ReCaptchaV3Provider' is not assignable to parameter of type 'AppCheckProvider'.
  Property 'getToken' is missing in type 'ReCaptchaV3Provider' but required in type 'AppCheckProvider'.

BTW the new version does not reflect the docs specified

Docs previous to version 8.9.0

firebase.initializeApp({
  // Your firebase configuration object
});

const appCheck = firebase.appCheck();
// Pass your reCAPTCHA v3 site key (public key) to activate(). Make sure this
// key is the counterpart to the secret key you set in the Firebase console.
appCheck.activate(
  'abcdefghijklmnopqrstuvwxy-1234567890abcd',

  // Optional argument. If true, the SDK automatically refreshes App Check
  // tokens as needed.
  true);
@google-oss-bot
Copy link
Contributor

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

@kroikie
Copy link

kroikie commented Aug 9, 2021

FYI: this is also showing up in our snippets repo which was bumped to 8.9.0

@hsubox76
Copy link
Contributor

hsubox76 commented Aug 9, 2021

There is a typings error in the main index.d.ts file. Fix is pending in #5261.

Both the provider argument and the string sitekey argument should be accepted (when the SDK is working correctly). Until the fix is released, you may be able to get around this temporarily with a //@ts-ignore.

@firebase firebase locked and limited conversation to collaborators Sep 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants