Our.Umbraco.Forms.uCaptcha 4.0.3

There is a newer version of this package available.
See the version list below for details.
dotnet add package Our.Umbraco.Forms.uCaptcha --version 4.0.3                
NuGet\Install-Package Our.Umbraco.Forms.uCaptcha -Version 4.0.3                
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="Our.Umbraco.Forms.uCaptcha" Version="4.0.3" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Our.Umbraco.Forms.uCaptcha --version 4.0.3                
#r "nuget: Our.Umbraco.Forms.uCaptcha, 4.0.3"                
#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 Our.Umbraco.Forms.uCaptcha as a Cake Addin
#addin nuget:?package=Our.Umbraco.Forms.uCaptcha&version=4.0.3

// Install Our.Umbraco.Forms.uCaptcha as a Cake Tool
#tool nuget:?package=Our.Umbraco.Forms.uCaptcha&version=4.0.3                

Our.Umbraco.Forms.uCaptcha

A simple to use and integrate captcha plugin for Umbraco Forms which supports hCaptcha, reCaptcha and Cloudflare Turnstile.

Getting started

This package is supported on Umbraco 10+ and Umbraco Forms 10+.

This package has been tested on Umbraco 11 and Umbraco Forms 11, however only LTS versions of Umbraco and Umbraco Forms are officially supported.

Breaking Changes:

V4.0.0 15 February 2023:

Cloudflare Turnstile has been reworked to use a signle javascript file removing umbracoforms.invisible.turnstile.js Cloudflare Turnstile has been reworked to use the cf- prefix instead of g- All javascript has been rewritten to remove jQuery dependency

Installation

UmbracoForms.uCaptcha is available from NuGet or as a manual download directly from GitHub.

dotnet add package Our.Umbraco.Forms.uCaptcha

Usage

This package adds hCaptcha, reCaptcha or Turnstile to Umbraco Forms, configurable in the appsettings.json.

It has the ability to choose from the traditional checkbox or invisible options.

Getting Started

Before you begin you will need to get your API keys from your preferred provider, you can get these from the links below:

hCaptcha

reCaptcha

Turnstile

You will need to add the following settings to your appsettings.json

  "uCaptcha": {
    "SiteKey": "YOUR SITE KEY",
    "SecretKey": "YOUR SECRET KEY",
    "Provider": "YOUR CHOSEN PROVIDER"
  }

To select the provider you will need to change the following setting to your appsettings.json

"Provider": "YOUR CHOSEN PROVIDER"

The choices are either hCaptcha or reCaptcha or Turnstile

Required theme tweak to Render.cshtml

Due to a change in Umbraco Forms you need to ensure the following is added to the file Partials/Forms/Themes/THEMENAME/Render.cshtml

@if (Model.CurrentPage.JavascriptCommands.Any())
{
    <script>
    document.addEventListener("DOMContentLoaded", function() {
        @foreach (var javascriptCommand in Model.CurrentPage.JavascriptCommands)
        {
            @Html.Raw(javascriptCommand)
        }
    });
</script>
}

If you are using the default theme you will need to create a custom theme using the zip found in the documentation here: https://docs.umbraco.com/v/10.x-lts/umbraco-forms/developer/themes

You can change the default theme used by Umbraco in your appsettings.json file

"Forms": {
    "FormDesign": {
      "DefaultTheme": "default",
    }
}

Reference: https://docs.umbraco.com/v/10.x-lts/umbraco-forms/developer/configuration

Turnstile configuration

The invisible option in the Settings Size dropdown does not do anything when using Cloudflare Turnstile, the invisible mode is controlled by the SiteKey.

Contribution guidelines

To raise a new bug, create an issue on the GitHub repository. To fix a bug or add new features, fork the repository and send a pull request with your changes. Feel free to add ideas to the repository's issues list if you would to discuss anything related to the package.

License

Copyright © 2023 UmbHost Limited.

Licensed under the MIT License.

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 was computed.  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 was computed.  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
5.0.0 1,669 1/2/2024
5.0.0-rc0001 168 12/19/2023
4.0.4 897 8/7/2023
4.0.3 966 2/15/2023
4.0.0 316 2/15/2023 4.0.0 is deprecated because it has critical bugs.
4.0.0-preview 249 2/1/2023 4.0.0-preview is deprecated because it has critical bugs.
3.1.2 864 11/24/2022
3.1.1 383 11/14/2022
3.1.0 513 10/20/2022
3.0.1 459 10/17/2022
3.0.0 580 6/16/2022
2.0.8 1,211 2/1/2022
2.0.5 661 2/1/2022
2.0.4 1,378 10/24/2021
2.0.3 1,090 10/14/2021

Fixed missing javascript reference