Angular
TrustCaptcha – Bot protection

Angular CAPTCHA Integration

Add TrustCaptcha to your Angular forms in minutes to block bots and spam on sign-ups, logins and checkouts. Users solve no image puzzles—just smooth protection. EU-hosted and GDPR-friendly, with risk scoring and security rules for stronger defense.

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

The following steps give you a rough idea of how to integrate the TrustCaptcha CAPTCHA widget into an Angular frontend. For precise, detailed instructions, please read the CAPTCHA integration guide for Angular in our documentation.

Read the documentation

First, install our TrustCaptcha Angular package:

Install
bash
npm i @trustcomponent/trustcaptcha-angular

Now insert the CAPTCHA widget, the so-called trustcaptcha-component HTML tag, into any HTML form:

app.component.ts
typescript
import {Component} from '@angular/core';
import {TrustcaptchaComponent} from '@trustcomponent/trustcaptcha-angular';

@Component({
  selector: 'app-root',
  standalone: true,
  imports: [TrustcaptchaComponent],
  template: `
    <form>
      <!-- your input fields -->
      <trustcaptcha-component
        sitekey="<your_site_key>"
        (captchaSolved)="solved($event)"
        (captchaFailed)="failed($event)"
      ></trustcaptcha-component>
      <!-- further input fields / submit button -->
    </form>
  `,
})
export class AppComponent {

  solved(event: Event): void {
    const verificationToken = (event as CustomEvent).detail;
    // handle success
  }

  failed(event: Event): void {
    const errorMessage = (event as CustomEvent).detail;
    // handle error
  }
}

The CAPTCHA widget will now be displayed on your Angular website:

CAPTCHA done

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

Other frontend technology instead of Angular?
If you do not want to use Angular or have several websites or applications, you can select a different framework or platform here. If there is no pre-built integration from us for your preferred frontend technology, your software developers can integrate the CAPTCHA themselves 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

Once the CAPTCHA is complete, take the verification token and send it to your backend. In your backend, retrieve the CAPTCHA verification result from our servers and validate the result. Depending on how high the bot risk is, you decide how to proceed. You can find detailed information on backend integration and result validation in our documentation.

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

.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 integrate TrustCaptcha in an Angular app?
You add the TrustCaptcha component to your Angular form and set your site key from the dashboard. After the user completes the challenge, you receive a verification token that your backend can validate.
Which Angular versions are supported?
We recommend Angular 14 or newer. Standalone components are the recommended setup today, but module-based Angular projects also work.
How do I get the verification token in Angular?
You can receive the token via an Angular event (recommended for most Angular apps) or read it from a hidden form field. Event-based handling works especially well with reactive forms and custom submit flows.
Do I still need server-side validation, or is the frontend token enough?
You should always validate on the server. Send the token to your backend and verify it using your secret key—this is the step that lets you make a reliable allow/deny decision.
Where should I place the CAPTCHA in longer forms?
Place it close to the final submit step. The verification token is time-limited (about 15 minutes), so solving it right before submitting avoids issues for users who spend longer on the form.
Does TrustCaptcha work with Angular SSR or pre-rendering?
Yes, but SSR setups may require extra care. If you run into issues, render the CAPTCHA only in the browser (after hydration) and keep the server-rendered output without the widget.
How can we run automated tests (Cypress/Playwright) without solving the CAPTCHA every time?
Use bypass keys for non-production environments to return a valid token quickly. Keep bypass keys out of production builds (use environment settings) and treat them like sensitive credentials.
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 Angular application with TrustCaptcha in just a few steps!

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