Frontend Integration
The following tutorial shows you how to integrate Trustcaptcha into your frontend using JavaScript, Angular, React, or Vue.
Preparation
The following preparations should be made before starting the implementation of Trustcaptcha in your frontend.
Requirements
- An account with Trustcaptcha and an existing CAPTCHA.
- A project where Trustcaptcha will be integrated.
Using the Library
The following explains how to use the library.
Select Technology
Choose your frontend technology.
Add Dependency
To use the Trustcaptcha library, you first need to add the appropriate dependencies to your project.
Trustcaptcha Component
Add the Trustcaptcha component to all desired form elements and provide the site key. The verification token will be available in the field tc-verification-token upon completion of the CAPTCHA and will automatically be submitted to the server along with other form data. Additionally, you can define what should happen when the CAPTCHA is successfully solved and what should happen in case of a failure.
Configure CaptchaHere you can interactively configure your Captcha. The source code below will automatically adjust.
Captcha Preview:
Implementation Example
The example below shows a possible implementation.
You can find an example including source code on Github.