import com.privatecaptcha.{PrivateCaptchaClient, PrivateCaptchaConfiguration, VerifyInput}
object FormHandler {
val client = new PrivateCaptchaClient(
new PrivateCaptchaConfiguration("YOUR_API_KEY")
)
// In your form handler, read private-captcha-solution from the form.
def submitForm(captchaSolution: String): Unit = {
val output = client.verify(
new VerifyInput(captchaSolution).setSitekey("YOUR_SITEKEY")
)
if (!output.ok()) {
throw new SecurityException(output.getErrorMessage())
}
// Verification passed. Process your form submission here.
}
}