Google Recaptcha
Google Recaptcha API Client for Elixir.
Installation
-
Add
google_recaptchato your list of dependencies inmix.exs:
def deps do
[{:google_recaptcha, "~> 0.1.0"}]
end-
Run
mix deps.getto install it.
Configuration
API keys is needed to get the client working, you can generate here
And set the keys in your project configuration file:
config :google_recaptcha,
api_url: "https://www.google.com/recaptcha/api/siteverify",
public_key: "YOUR_PUBLIC_KEY",
private_key: "YOUR_SECRET_KEY",
enabled: true # You may set false for developmentDocumentation
Examples
GoogleRecaptcha.verify(captcha_response, client_ip_addres)
#captcha_response => g-recaptcha-response POST paramter from captcha widget