UNPKG

react-native-recaptcha-enterprise

Version:

Google Enterprise reCaptcha library for React-Native. Real native implementation for iOS and Android.

38 lines 1.43 kB
import type { CanUseResult, ExecuteActions } from './types'; /** * Checks that `Google ReCaptcha` is callable on native layer. * (It is called under the hood in {@link initializeRecaptcha} on native part.) * * It is not available in some cases: * 1. If module is not linked correctly. * {Possible fix} - Try to re-install package and check it out again. * 2. If there is no `Google Play Services`. As library use them on Android platform. * [Android only] * {Possible fix} - Impossible! Ignore the library on such phones. * * @return boolean flag value * `TRUE` - captcha module is available; * `FALSE`- not available. */ export declare function canUseRecaptcha(): Promise<CanUseResult>; /** * Initializes reCaptcha client with given siteKey * * @param {string} siteKey - Google Site Key * * @throws RecaptchaErrorType exception */ export declare function initializeRecaptcha(siteKey: string): Promise<void>; /** * Executes action and returns verify token. * * @param {string} actionName - Type of performed action. Predefined is "LOGIN" only. * All other actions will be handled as custom ones (with **"custom_"** prefix). * * @returns Returns ReCaptcha token to verify user on backend|REST|etc. * (in the end on Google server side) * * @throws RecaptchaErrorType exception */ export declare function executeAction(actionName: ExecuteActions): Promise<string>; //# sourceMappingURL=index.d.ts.map