Table of Contents

Class CreateTurnstileWidgetRequest

Namespace
Cloudflare.NET.Turnstile.Models
Assembly
Cloudflare.NET.dll

Request to create a new Turnstile widget.

The created widget will have a unique sitekey (public key) and secret (private key). The secret is only returned in the create response - store it securely.

public record CreateTurnstileWidgetRequest : IEquatable<CreateTurnstileWidgetRequest>
Inheritance
CreateTurnstileWidgetRequest
Implements
Inherited Members

Constructors

CreateTurnstileWidgetRequest(string, IReadOnlyList<string>, WidgetMode, bool?, ClearanceLevel?, bool?, bool?, string?)

Request to create a new Turnstile widget.

The created widget will have a unique sitekey (public key) and secret (private key). The secret is only returned in the create response - store it securely.

public CreateTurnstileWidgetRequest(string Name, IReadOnlyList<string> Domains, WidgetMode Mode, bool? BotFightMode = null, ClearanceLevel? ClearanceLevel = null, bool? EphemeralId = null, bool? Offlabel = null, string? Region = null)

Parameters

Name string

Widget name for identification.

Domains IReadOnlyList<string>

Allowed domains for this widget.

Mode WidgetMode

Widget mode (invisible, managed, or non-interactive).

BotFightMode bool?

Enable bot fight mode. Defaults to false if not specified.

ClearanceLevel ClearanceLevel?

Challenge clearance level.

EphemeralId bool?

Use ephemeral IDs. Defaults to false if not specified.

Offlabel bool?

Allow off-label use. Defaults to false if not specified.

Region string

Geographic region for the widget.

Properties

BotFightMode

Enable bot fight mode. Defaults to false if not specified.

[JsonPropertyName("bot_fight_mode")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public bool? BotFightMode { get; init; }

Property Value

bool?

ClearanceLevel

Challenge clearance level.

[JsonPropertyName("clearance_level")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public ClearanceLevel? ClearanceLevel { get; init; }

Property Value

ClearanceLevel?

Domains

Allowed domains for this widget.

[JsonPropertyName("domains")]
public IReadOnlyList<string> Domains { get; init; }

Property Value

IReadOnlyList<string>

EphemeralId

Use ephemeral IDs. Defaults to false if not specified.

[JsonPropertyName("ephemeral_id")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public bool? EphemeralId { get; init; }

Property Value

bool?

Mode

Widget mode (invisible, managed, or non-interactive).

[JsonPropertyName("mode")]
public WidgetMode Mode { get; init; }

Property Value

WidgetMode

Name

Widget name for identification.

[JsonPropertyName("name")]
public string Name { get; init; }

Property Value

string

Offlabel

Allow off-label use. Defaults to false if not specified.

[JsonPropertyName("offlabel")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public bool? Offlabel { get; init; }

Property Value

bool?

Region

Geographic region for the widget.

[JsonPropertyName("region")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Region { get; init; }

Property Value

string