# RecaptchaEnterprise Framework Reference

# Recaptcha


    @interface Recaptcha : NSObject

Interface to interact with reCAPTCHA.
- `


  ### [+fetchClientWithSiteKey:completion:](https://docs.cloud.google.com/recaptcha/docs/reference/ios/client/api/Classes/Recaptcha#/c:objc(cs)Recaptcha(cm)fetchClientWithSiteKey:completion:)


  ` Builds a new reCAPTCHA Client for the given Site Key and timeout.

  The SDK supports one Site Key. Passing a different Site Key will
  throw an exception.

  #### Declaration

  Swift

      class func fetchClient(withSiteKey siteKey: String) async throws -> https://docs.cloud.google.com/recaptcha/docs/reference/ios/client/api/Classes/RecaptchaClient.html

  Objective-C

      + (void)fetchClientWithSiteKey:(nonnull NSString *)siteKey
                          completion:(nonnull void (^)(https://docs.cloud.google.com/recaptcha/docs/reference/ios/client/api/Classes/RecaptchaClient.html *_Nullable,
                                                       NSError *_Nullable))completion;

  #### Parameters

  |---|---|
  | ` siteKey ` | reCAPTCHA Site Key for the app. |
  | ` completion ` | Callback function to return the RecaptchaClient or an error. |

- `


  ### [+getClientWithSiteKey:withTimeout:completion:](https://docs.cloud.google.com/recaptcha/docs/reference/ios/client/api/Classes/Recaptcha#/c:objc(cs)Recaptcha(cm)getClientWithSiteKey:withTimeout:completion:)


  ` Builds a new reCAPTCHA Client for the given Site Key and timeout.

  The SDK supports one Site Key. Passing a different Site Key will
  throw an exception.

  At least a 10000 millisecond timeout is suggested to allow for slow
  networking, though in some cases longer timeouts may be necessary. The
  minimum allowable value is 5000 milliseconds.

  #### Declaration

  Swift

      class func getClient(withSiteKey siteKey: String, withTimeout timeout: Double) async throws -> https://docs.cloud.google.com/recaptcha/docs/reference/ios/client/api/Classes/RecaptchaClient.html

  Objective-C

      + (void)getClientWithSiteKey:(nonnull NSString *)siteKey
                       withTimeout:(double)timeout
                        completion:(nonnull void (^)(https://docs.cloud.google.com/recaptcha/docs/reference/ios/client/api/Classes/RecaptchaClient.html *_Nullable,
                                                     NSError *_Nullable))completion;

  #### Parameters

  |---|---|
  | ` siteKey ` | reCAPTCHA Site Key for the app. |
  | ` timeout ` | Timeout for getClient in milliseconds. |
  | ` completion ` | Callback function to return the RecaptchaClient or an error. |

- `


  ### [+getClientWithSiteKey:completion:](https://docs.cloud.google.com/recaptcha/docs/reference/ios/client/api/Classes/Recaptcha#/c:objc(cs)Recaptcha(cm)getClientWithSiteKey:completion:)


  ` Builds a new reCAPTCHA Client for the given Site Key.

  The SDK supports one Site Key. Passing a different Site Key will
  throw an exception.

  This method will timeout after 10 seconds.

  #### Declaration

  Swift

      class func getClient(withSiteKey siteKey: String) async throws -> https://docs.cloud.google.com/recaptcha/docs/reference/ios/client/api/Classes/RecaptchaClient.html

  Objective-C

      + (void)getClientWithSiteKey:(nonnull NSString *)siteKey
                        completion:(nonnull void (^)(https://docs.cloud.google.com/recaptcha/docs/reference/ios/client/api/Classes/RecaptchaClient.html *_Nullable,
                                                     NSError *_Nullable))completion;

  #### Parameters

  |---|---|
  | ` siteKey ` | reCAPTCHA Site Key for the app. |
  | ` completion ` | Callback function to return the RecaptchaClient or an error. |

[## Deprecated APIs and properties.](https://docs.cloud.google.com/recaptcha/docs/reference/ios/client/api/Classes/Recaptcha#/Deprecated-APIs-and-properties.)

- `


  ### [+getClientWithSiteKey:completionHandler:](https://docs.cloud.google.com/recaptcha/docs/reference/ios/client/api/Classes/Recaptcha#/c:objc(cs)Recaptcha(cm)getClientWithSiteKey:completionHandler:)


  ` Deprecated

  Use the new method getClient(withSiteKey:timeout:completion:)
  Builds a new reCAPTCHA Client for the given SiteKey.

  This method will timeout after 10 seconds.

  #### Declaration

  Swift

      class func getClient(siteKey: String) async -> (https://docs.cloud.google.com/recaptcha/docs/reference/ios/client/api/Classes/RecaptchaClient.html?, https://docs.cloud.google.com/recaptcha/docs/reference/ios/client/api/Classes/RecaptchaError.html?)

  Objective-C

      + (void)getClientWithSiteKey:(nonnull NSString *)siteKey
                 completionHandler:
                     (nonnull void (^)(https://docs.cloud.google.com/recaptcha/docs/reference/ios/client/api/Classes/RecaptchaClient.html *_Nullable,
                                       https://docs.cloud.google.com/recaptcha/docs/reference/ios/client/api/Classes/RecaptchaError.html *_Nullable))completionHandler;

  #### Parameters

  |---|---|
  | ` siteKey ` | reCAPTCHA Site Key for the app. |
  | ` completionHandler ` | Callback function to return the RecaptchaClient or an error. |