BlazorTurnstile 2.1.1

dotnet add package BlazorTurnstile --version 2.1.1                
NuGet\Install-Package BlazorTurnstile -Version 2.1.1                
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="BlazorTurnstile" Version="2.1.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add BlazorTurnstile --version 2.1.1                
#r "nuget: BlazorTurnstile, 2.1.1"                
#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 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                

Nuget version Nuget downloads

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 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. 
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
2.1.1 3,326 8/1/2024
2.1.0 4,478 12/9/2023
2.0.0 148 11/30/2023
1.1.0 359 11/10/2023
1.0.0 348 7/15/2023
1.0.0-preview.1 108 7/12/2023