hcaptcha v0.0.2 Hcaptcha View Source

A module for verifying hCAPTCHA version 1 response strings.

See the documentation for more details.

Link to this section Summary

Functions

Verifies a hCAPTCHA response string

Link to this section Functions

Link to this function

verify(response, options \\ []) View Source
verify(String.t(), Keyword.t()) ::
  {:ok, Hcaptcha.Response.t()} | {:error, [atom()]}

Verifies a hCAPTCHA response string.

Options

  • :timeout - the timeout for the request (defaults to 5000ms)
  • :secret - the secret key used by hcaptcha (defaults to the secret provided in application config)
  • :remote_ip - the IP address of the user (optional and not set by default)

Example

{:ok, api_response} = Hcaptcha.verify("response_string")