Eiliko.Blazor.hCaptcha 0.2.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Eiliko.Blazor.hCaptcha --version 0.2.0                
NuGet\Install-Package Eiliko.Blazor.hCaptcha -Version 0.2.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Eiliko.Blazor.hCaptcha" Version="0.2.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Eiliko.Blazor.hCaptcha --version 0.2.0                
#r "nuget: Eiliko.Blazor.hCaptcha, 0.2.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Eiliko.Blazor.hCaptcha as a Cake Addin
#addin nuget:?package=Eiliko.Blazor.hCaptcha&version=0.2.0

// Install Eiliko.Blazor.hCaptcha as a Cake Tool
#tool nuget:?package=Eiliko.Blazor.hCaptcha&version=0.2.0                

Eiliko.Blazor.hCaptcha

NuGet

ASP.NET Core hCaptcha Component for Server-Side Blazor.

Installation

PM> Install-Package Texnomic.Blazor.hCaptcha

Setup

  1. Reference hCaptcha & NuGet Package JavaScript Files In Components/App.razor File:

    <head>
    
    <script src="https://hcaptcha.com/1/api.js&render=explicit" async type="text/javascript"></script>
    
    <script src="_content/Texnomic.Blazor.hCaptcha/scripts/hCaptcha.js" type="text/javascript"></script>
    
    </head>
    
  2. Add Package Configuration To Dependancy Injection Services in Program.cs File:

    using Texnomic.Blazor.hCaptcha.Extensions;
    
    
        builder.Services.AddHttpClient();
        builder.Services.AddHCaptcha(Options =>
        {
            Options.SiteKey = "10000000-ffff-ffff-ffff-000000000001";
            Options.Secret = "0x0000000000000000000000000000000000000000";
        });
    
  3. Create Callback Function & Backing Field To Capture Captcha Result In Example.razor File:

    private bool IsCaptchaValid { get; set; }
    
    protected void hCaptchaCallback(bool Result) => IsCaptchaValid = Result;
    
  4. Finally, Drop-In hCaptcha Component & Bind Callback Function In Example.razor File:

    <HCaptcha Callback="hCaptchaCallback" Theme="Theme.Dark"></HCaptcha>
    
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.3.1 124 12/10/2024
0.3.0 107 11/25/2024
0.2.2 116 11/2/2024
0.2.1 100 11/2/2024
0.2.0 102 11/2/2024