Scala
TrustCaptcha – Bot protection

Scala CAPTCHA Integration

Stop fake sign-ups, login brute force and form spam in your Scala apps in minutes with TrustCaptcha’s Scala integration. You get an instant pass/fail plus risk score to route or block suspicious traffic. Privacy-first, EU-hosted, no cookies, and no image puzzles—built for accessibility.

Quickstart

How the integration works

1. Create a CAPTCHA

Create a user account or log in with an existing one. Then create a new CAPTCHA or select an existing one. If you’re unsure whether TrustCaptcha is right for you, try our CAPTCHA service risk-free for 14 days at no cost.

On the CAPTCHA overview page, you will find all the important information, such as the site key, secret key and licence key. Allow your websites to access your CAPTCHA by simply adding them to the access authorised domain list in the CAPTCHA security rules.

Start of the CAPTCHA creation form.
CAPTCHA security rules of a demo CAPTCHA.

2. Integrate the CAPTCHA widget into your frontend

Integrate the CAPTCHA widget into your website or app. For precise, detailed instructions, please read the CAPTCHA widget guide in our documentation.

Read the documentation

The CAPTCHA widget will then be displayed on your website or app:

CAPTCHA done

Prebuild frontend integrations
You can use one of our pre-built frontend integrations to integrate the CAPTCHA widget into your website or application. If there is no pre-built integration from us for your preferred frontend technology, your software developers can integrate the CAPTCHA themselves using using our documentation or ask our support-team for a pre-built integration solution.

Android
Angular
Craft CMS
Flutter
iOS
JavaScript
Joomla
Keycloak
Magento 2
React
React Native
TYPO3
Vue
Webflow
WordPress

3. Validate the CAPTCHA result in your backend

The following steps give you an idea of how to retrieve the CAPTCHA verification result from our server in a Scala backend and determine how to proceed based on this result. For precise, detailed instructions, please read the CAPTCHA integration guide for Scala in our documentation.

Read the documentation

First, install our TrustCaptcha Scala dependency:

Maven Central
XML
<dependency>
  <groupId>com.trustcomponent</groupId>
  <artifactId>trustcaptcha</artifactId>
  <version>2.0.0</version>
</dependency>

Retrieve the verification result from our server using the verification token and the secret key of your CAPTCHA:

Fetch Result
Scala
// Retrieving the verification result
var verificationResult: VerificationResult = null
try {
  verificationResult = CaptchaManager.getVerificationResult("<your_secret_key>", "<verification_token_from_your_client>")
} catch {
  case e: CaptchaFailureException =>
  // Fetch verification result failed - handle error
}

Based on the verification results and your individual needs, decide how you would like to proceed:

Handle Result
Scala
// Act on the verification result
if (!verificationResult.isVerificationPassed || verificationResult.getScore > 0.5) {
  logger.warn("Verification failed or bot score > 0.5 – possible automated request.")
}

Need detailed information about the Scala CAPTCHA integration?
For detailed instructions on integrating TrustCaptcha, please refer to our Scala CAPTCHA integration guide. A complete integration example for the Scala CAPTCHA can be found in our CAPTCHA Samples Repository on Github.

Other backend technology instead of Scala?
If you do not want to use Scala on your server or have several different backends, you can select a different integration here. If there is no pre-built integration from us for your preferred backend technology, your software developers can integrate the CAPTCHA verification process themselves using our documentation or ask our support-team for a pre-built integration.

.Net
Go
Groovy
Java
Kotlin
Nodejs
PHP
Python
Ruby
Rust
Scala
Spring

4. Congratulations 🎉

You are now protected by TrustCaptcha - congratulations!

CAPTCHA done

FAQs

What is a Scala CAPTCHA?
A Scala CAPTCHA is a challenge-response mechanism embedded in a Scala or Akka application that separates real visitors from automated scripts. It typically runs a lightweight client widget and validates the resulting token on your Scala backend. Modern solutions such as TrustCaptcha automate the proof-of-work behind the scenes so end-users hardly notice anything. They also respect EU-level security and privacy standards.
What is the best Scala CAPTCHA?
The “best” CAPTCHA balances airtight security, GDPR compliance, developer ergonomics, and a friction-free user experience. In 2025 many teams choose TrustCaptcha because its multi-layered proof-of-work plus AI-driven bot-score blocks even advanced bots while keeping data in the EU. Pre-built Scala libraries, a generous free tier, and fine-grained styling options cut integration time to minutes. Whatever provider you pick, make sure it offers EU hosting and an online DPA.
How does a Scala CAPTCHA work?
On the client side the widget silently solves a cryptographic puzzle and gathers risk signals, then returns a signed token. Your Scala controller posts this token together with your site-key and secret-key to the CAPTCHA API and receives a JSON verdict with the bot probability. With TrustCaptcha you can tune thresholds, IP allow/deny lists, or create bypass keys for automated tests. All traffic is TLS-encrypted, so no sensitive data leaks in transit.
Do I need a Scala CAPTCHA?
If your Scala site exposes forms, authentication flows, or public APIs, a CAPTCHA is still the simplest first line of defence. Recent reports show that bots already generate more than a third of all web traffic and 89 % of that traffic is unwanted, with e-commerce and content platforms hit hardest. A privacy-first CAPTCHA such as TrustCaptcha blocks these attacks without frustrating humans or screen-reader users. For purely internal apps you might rely on rate-limiting, but public endpoints benefit from layered protection.
Is TrustCaptcha GDPR-compliant for EU projects?
Yes. TrustCaptcha stores and processes CAPTCHA data exclusively in EU data centres and never sets tracking cookies. You can conclude a Data Processing Agreement (DPA) and Service-Level Agreement entirely online within minutes. An optional “Minimal Data Mode” is available for projects that need to minimise personal data even further.
Can I customise the look of TrustCaptcha in my Scala app?
Absolutely. TrustCaptcha lets you switch between light, dark or auto themes, override any colour and hide the branding for a white-label experience. You can also supply your own translations for 35 + languages, adjust width or corner radius and even make the widget invisible while it runs. All options are simple HTML attributes or JavaScript flags, so they work with Scala.js, Play templates or any front-end stack.
How does TrustCaptcha improve accessibility over image-based CAPTCHAs?
Traditional CAPTCHAs force users to decipher distorted text or click tiny images—an obstacle for screen-reader and keyboard users. TrustCaptcha’s automated proof-of-work begins as soon as the form gains focus and finishes in seconds with no puzzles, meeting WCAG 2.2 guidelines. Because there is nothing to solve visually, users with disabilities encounter almost zero friction. That boosts conversion rates while still blocking bots.
Losing leads to CAPTCHAs?

TrustCaptcha blocks spam and bots, not customers. No puzzles, GDPR-ready, EU-hosted.

CAPTCHA start
CAPTCHA done
Puzzle-free UX
Runs in the background while visitors type — so more people finish your forms and fewer drop off.
GDPR-ready
EU-hosted and privacy-first: no cookies, encrypted transmission, automatic cleanup — with ready-to-use legal resources.
Multi-layer Security
Adaptive protection plus intelligent risk scoring stops abuse early — even when attack traffic spikes.
Full Control
Fine-tune sensitivity, set allow/block lists, and use geoblocking — you decide how strict verification should be.

Protect your Scala application with TrustCaptcha in just a few steps!

  • EU-hosted & GDPR-ready
  • No puzzles
  • Try free for 14 days