BlazorTurnstile 2.1.1
dotnet add package BlazorTurnstile --version 2.1.1
NuGet\Install-Package BlazorTurnstile -Version 2.1.1
<PackageReference Include="BlazorTurnstile" Version="2.1.1" />
paket add BlazorTurnstile --version 2.1.1
#r "nuget: BlazorTurnstile, 2.1.1"
// Install BlazorTurnstile as a Cake Addin #addin nuget:?package=BlazorTurnstile&version=2.1.1 // Install BlazorTurnstile as a Cake Tool #tool nuget:?package=BlazorTurnstile&version=2.1.1
BlazorTurnstile
A Blazor library for Cloudflare's Turnstile.
This library provides an easy to use Component for both Blazor Server and Webassembly, with parameters for options and callbacks. See the sample project for common usages.
Installing
To install the package add the following line to you csproj file replacing x.x.x with the latest version number (found at the top of this file):
<PackageReference Include="BlazorTurnstile" Version="x.x.x" />
You can also install via the .NET CLI with the following command:
dotnet add package BlazorTurnstile
If you're using Visual Studio you can also install via the built in NuGet package manager.
Setup
Blazor Server applications will need to include the following JS file in their _Host.cshtml
.
Blazor Client applications will need to include the following JS file in their Index.html
.
Add the JS script at the bottom of the page using the following script tag.
<script src="https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit"></script>
Usage
The component can be used standalone or as part of a form.
Use the BlazorTurnstile
component to render the Cloudflare Turnstile widget.
@using BlazorTurnstile
<Turnstile @bind-Token="@_turnstileToken"
SiteKey="[your-site-key]"
Appearance="@TurnstileAppearance.Always"
Execution="@TurnstileExecution.Render"
Theme="@TurnstileTheme.Light"
OnCallback="@TurnstileCallback"
OnErrorCallback="@TurnstileErrorCallback"
ResponseField="@false" />
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. 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. |
-
net6.0
- Microsoft.AspNetCore.Components.Web (>= 6.0.12)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 6.0.0)
-
net7.0
- Microsoft.AspNetCore.Components.Web (>= 7.0.8)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 7.0.0)
-
net8.0
- Microsoft.AspNetCore.Components.Web (>= 8.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.