Rust
TrustCaptcha – Bot protection

Rust CAPTCHA Integration

Add TrustCaptcha to your Rust backend to stop bot sign-ups, form spam, and API abuse. Validate the verification token in minutes with our step-by-step Rust integration. Puzzle-free UX, EU hosting and GDPR-ready processing included.

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 Rust backend and determine how to proceed based on this result. For precise, detailed instructions, please read the CAPTCHA integration guide for Rust in our documentation.

Read the documentation

First, install our TrustCaptcha Rust dependency:

Install
bash
cargo add trustcaptcha

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

Fetch Result
Rust
// Retrieving the verification result
let verification_result = match CaptchaManager::get_verification_result(secret_key, "<verification_token_from_your_client>").await {
  Ok(result) => result,
  Err(e) => {
    // Fetch verification result failed - handle error
    error!("Failed to fetch verification result: {}", e);
    return Ok(HttpResponse::InternalServerError().json(json!({"error": "Captcha verification failed"})));
  }
};

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

Handle Result
Rust
// Act on the verification result
if !verification_result.verification_passed || verification_result.score > 0.5 {
  info!("Verification failed or bot score > 0.5 – possible automated request.");
}

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

Other backend technology instead of Rust?
If you do not want to use Rust 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 do I need to validate a TrustCaptcha CAPTCHA in a Rust backend?
You receive a verification token from the frontend, then your Rust backend calls the TrustComponent verification API using your secret key. The response is a verification result you can use to allow, review, or block the request.
Do I still need a frontend integration if I use Rust on the backend?
Yes. The CAPTCHA is solved in the frontend (website or app). Only after a user solves it, a verification token is created. Your Rust backend can only validate what it receives from the frontend.
How does the verification token reach my Rust backend?
That’s up to your application. The token can be sent in a form submit, a JSON body, a request header, or another transport. The important part is: your backend must receive the verification token reliably and then validate it server-side.
What do “verification passed” and “bot-score” mean?
Always check verification passed first: it confirms the CAPTCHA flow was successful (including Proof of Work and any security rules such as IP/geo rules). Then check the bot-score: it’s a risk score from 0 (likely human) to 1 (likely bot). You decide what score is acceptable for your use case.
How should I choose a decision threshold for the bot-score?
A simple starting point is a single threshold, for example 0.5: below it you accept, above it you block. If you want stricter protection, lower the threshold (e.g., 0.3–0.4). If you want fewer blocks, raise it (e.g., 0.6–0.7). You can also use multiple levels, such as: accept (low), add extra checks like email/2FA (medium), block (high).
How long is a verification token valid, and what happens if the API is not reachable?
A verification token is single-use and valid for 15 minutes. If the verification call fails because the API is not reachable, the safe approach is fail closed: the request cannot be trusted, so the user needs to solve the CAPTCHA again to generate a new verification token.
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 Rust application with TrustCaptcha in just a few steps!

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