Vue.js
TrustCaptcha – Bot protection

Vue.js CAPTCHA Integration

TrustCaptcha is a Vue.js CAPTCHA integration that protects logins, registrations, and contact forms with risk-based bot detection. Follow this page to embed the widget and verify each check on your server. Privacy-first, EU-hosted, GDPR-ready, and fully accessible—no image puzzles.

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 Vue.js frontend. For precise, detailed instructions, please read the CAPTCHA integration guide for Vue.js in our documentation.

Read the documentation

First, install our TrustCaptcha Vue.js package:

Install
bash
npm i @trustcomponent/trustcaptcha-vue

Register the TrustCaptcha element as a custom element:

vite-config.js
JavaScript
export default defineConfig({
  plugins: [
    vue({
      template: {
        compilerOptions: {
          isCustomElement: (tag) => tag.includes('trustcaptcha'),
        }
      }
    }),
  ],
})

Add the TrustCaptcha component to your application:

main.js
JavaScript
import {TrustcaptchaComponent} from "@trustcaptcha/trustcaptcha-vue";

createApp(App).use(TrustcaptchaComponent).mount('#app')

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

app.vue
Vue
<form>
  <!-- your input fields -->
  <trustcaptcha-component
    sitekey="<your_site_key>"
    @captchaSolved="handleSuccess($event.detail)"
    @captchaFailed="handleError($event.detail)"
    ></trustcaptcha-component>
  <!-- further input fields / submit button -->
</form>

The CAPTCHA widget will now be displayed on your Vue.js website:

CAPTCHA done

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

Other frontend technology instead of Vue.js?
If you do not want to use Vue.js 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 is TrustCaptcha for Vue?
TrustCaptcha is a privacy-first CAPTCHA widget you can add to Vue forms to stop bots and spam without image puzzles. It combines proof-of-work with a risk-based verification result and optional security rules, so you can protect sign-ups, contact forms, checkouts, and more.
How does the Vue integration work (in simple terms)?
You place the TrustCaptcha widget in your Vue form. After a user completes it, your page receives a verification token. Your backend sends that token to TrustCaptcha to fetch the verification result (for example, a risk score) and then decides whether to accept or block the request.
What do I need to set it up in a Vue project?
You need a TrustCaptcha account and a CAPTCHA "sitekey" from your dashboard, plus the Vue package. In your Vue project you install the package, register the component once, and then place the <trustcaptcha-component> on the page with your sitekey.
Does the widget have to be inside a <form> element?
Yes. The TrustCaptcha component must be placed inside an HTML <form>. If your page doesn’t use forms today, you can wrap a small form around the widget and your submit button.
Do I still need server-side validation?
Yes — always. The verification token from the browser must be checked on your server (using your secret key) to retrieve the official verification result. Without server-side validation, the integration is not secure.
How do I get the verification token, and how long is it valid?
After a successful verification, the token is available either as a hidden form field (default name: tc-verification-token) or via the captchaSolved event. By default the token is single-use and valid for 15 minutes, so for multi-step flows it’s best to place the widget near the final submit step.
Can I use more than one TrustCaptcha widget on the same page?
Yes. Multiple forms can each have their own widget. If you place multiple widgets inside the same form, make sure each widget uses a different token field name (or rely on events) so tokens don’t overwrite each other.
Can I customize language, theme, or branding?
Yes. You can set basics like language and light/dark theme. Advanced options such as invisible mode, hiding branding, custom design, and a custom privacy link are available with a license key (depending on your plan).
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 Vue.js application with TrustCaptcha in just a few steps!

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