Substantive.Blazor.Captcha 9.4.0-build20260401r4

Blazor.Captcha

Blazor.Captcha is a .NET 10 Blazor component library for integrating CAPTCHA widgets (Google reCAPTCHA v2/v3 and hCaptcha) into Blazor WebAssembly and Server applications. It provides reusable components, JSInterop adapters, and flexible configuration for secure user validation.

Features

  • Google reCAPTCHA v2: Interactive challenge widget.
  • Google reCAPTCHA v3: Background risk scoring and badge.
  • hCaptcha: Privacy-focused CAPTCHA alternative.
  • Blazor-idiomatic API: Use as Razor components with event callbacks.
  • Culture, theme, and position customization.
  • AOT compatible and supports .NET 10.
  • JSInterop adapters for script management and event handling.
  • Extensive logging via ILogger.

Installation

  1. Add the NuGet package to your project:
dotnet add package Blazor.Captcha
  1. Register required services in your Program.cs:
builder.Services.AddBlazorCaptcha();

Usage

Google reCAPTCHA v2

@using Substantive.Blazor.Captcha

<ReCaptchaV2 SiteKey="your-site-key"
             OnSuccess="HandleSuccess"
             OnExpired="HandleExpired" />

Google reCAPTCHA v3

@using Substantive.Blazor.Captcha

<ReCaptchaV3 SiteKey="your-site-key"
             Position="ReCaptchaV3Position.BottomRight"
             OnSuccess="HandleSuccess" />

hCaptcha

@using Substantive.Blazor.Captcha

<HCaptcha SiteKey="your-hcaptcha-site-key"
          Size="HCaptchaSize.Normal"
          OnSuccess="HandleSuccess"
          OnExpired="HandleExpired" />

Event Callbacks

  • OnSuccess: Invoked with the CAPTCHA token when completed.
  • OnExpired: Invoked when the challenge expires.

Resetting Captcha

Each component exposes a ResetCaptcha() method to allow users to retry the challenge.

Configuration

  • Culture: Set via the Culture parameter (e.g., "en", "fr").
  • Theme: Automatically detects dark/light theme for reCAPTCHA v3.
  • Position: For reCAPTCHA v3 badge (BottomRight, BottomLeft, Inline).
  • Size: For hCaptcha (Normal, Compact, Invisible).

Advanced

  • JSInterop adapters (ReCaptchaV2JS, ReCaptchaV3JS, HCaptchaJS) can be injected for direct control.
  • Logging extensions for diagnostics.
  • Custom JSON converter for widget IDs.

Showing the top 20 packages that depend on Substantive.Blazor.Captcha.

Packages Downloads
Substantive.Metapackage.BlazorComponents
A metapackage contains all Blazor components.
3
Substantive.Metapackage.BlazorComponents
A metapackage contains all Blazor components.
6
Substantive.Metapackage.BlazorComponents
A metapackage contains all Blazor components.
7
Substantive.Metapackage.BlazorComponents
A metapackage contains all Blazor components.
8
Substantive.Metapackage.BlazorComponents
A metapackage contains all Blazor components.
13
Substantive.Metapackage.BlazorComponents
A metapackage contains all Blazor essential building blocks. It packed standalone Blazor components and extensions that often use such as Navigation, Exception Handling, Localization, etc,.
8

.NET 10.0

Version Downloads Last updated
9.4.0-build20260414R2 2 04/14/2026
9.4.0-build20260414R1 2 04/14/2026
9.4.0-build20260410R1 3 04/10/2026
9.4.0-build20260408R1 2 04/08/2026
9.4.0-build20260407R1 3 04/07/2026
9.4.0-build20260403R7 3 04/03/2026
9.4.0-build20260403R6 3 04/03/2026
9.4.0-build20260403R5 1 04/03/2026
9.4.0-build20260401R5 4 04/01/2026
9.4.0-build20260401R4 1 04/01/2026
9.4.0-build20260401R3 1 04/01/2026
9.4.0-build20260401R2 1 04/01/2026
9.4.0-build20260401R1 1 04/01/2026
9.4.0-build20260331R7 2 03/31/2026
9.4.0-build20260331R6 1 03/31/2026
9.4.0-build20260331R5 1 03/31/2026
9.4.0-build20260331R4 1 03/31/2026
9.4.0-build20260331R3 1 03/31/2026
9.4.0-build20260331R2 1 03/31/2026
9.4.0-build20260331R1 1 03/31/2026
9.4.0-build20260330R4 2 03/30/2026
9.4.0-build20260330R3 3 03/30/2026
9.4.0-build20260329R1 2 03/29/2026
9.4.0-build20260318R3 5 03/18/2026
9.4.0-build20260317R1 2 03/17/2026
9.4.0-build20260217R3 4 02/17/2026
9.4.0-build20260207R3 3 02/07/2026
9.4.0-build20260207R2 1 02/07/2026
9.4.0-build20260207R1 1 02/07/2026
9.4.0-build20260206R6 2 02/06/2026
9.4.0-build20260206R5 1 02/06/2026
9.4.0-build20260206R4 1 02/06/2026
9.4.0-build20260206R3 1 02/06/2026
9.4.0-build20260206R2 1 02/06/2026
9.4.0-build20260205R1 3 02/05/2026
9.4.0-build20260115R1 13 01/15/2026
9.4.0-build20260114R5 3 01/14/2026
9.4.0-build20260114R4 3 01/14/2026
9.4.0-build20260114R3 3 01/14/2026
9.4.0-build20260114R2 3 01/14/2026
9.4.0-build20260114R1 3 01/14/2026
9.4.0-build20260113R2 4 01/13/2026
9.4.0-build20260109R1 4 01/09/2026
9.4.0-build20251226R1 4 12/26/2025
9.3.3-build20251226R1 2 12/26/2025
9.3.2-build20251225R1 4 12/25/2025
9.3.0-build20251223R1 3 12/23/2025
9.2.0-build20251222R2 4 12/22/2025
9.2.0-build20251222R1 3 12/22/2025
9.1.0-build20251218R1 3 12/18/2025
9.1.0-build20251217R1 4 12/17/2025
9.1.0-build20251215R1 5 12/15/2025
9.1.0-build20251212R1 3 12/12/2025
9.1.0-build20251211R1 4 12/11/2025
9.1.0-build20251207R1 4 12/07/2025
9.1.0-build20251203R1 2 12/03/2025
9.1.0-build20251202R1 2 12/02/2025
9.1.0-build20251201R1 2 12/01/2025
9.1.0-build20251128R3 3 11/28/2025
9.1.0-build20251128R2 3 11/28/2025
9.1.0-build20251128R1 2 11/28/2025
9.0.4-build20251127R1 11 11/27/2025
9.0.4-build20251125R1 5 11/25/2025
9.0.4-build20251124R6 4 11/24/2025
9.0.4-build20251124R4 4 11/24/2025
9.0.4-build20250909R1 2 09/09/2025