Skip to content

Commit 14be413

Browse files
widget mgmt pt 2
1 parent b5649dc commit 14be413

File tree

8 files changed

+81
-23
lines changed

8 files changed

+81
-23
lines changed

src/content/docs/turnstile/get-started/index.mdx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ sidebar:
66
---
77

88

9-
import { GlossaryTooltip, Render, LinkButton } from "~/components"
9+
import { Render, LinkButton } from "~/components"
1010

1111
This guide will get you started on setting up the Turnstile widget to protect your website from bots while maintaining a seamless user experience.
1212

@@ -56,14 +56,9 @@ Follow the steps below to implement Turnstile.
5656

5757
First, you must create a Turnstile widget to get your sitekey and secret key.
5858

59-
Select your preferred method:
59+
Select your preferred implementation method:
6060

61-
62-
<LinkButton href="/">Cloudflare dashboard</LinkButton>
63-
64-
<LinkButton href="/">API</LinkButton>
65-
66-
<LinkButton href="/">Terraform</LinkButton>
61+
<Render file="implementation-methods" />
6762

6863
### 2. Embed the widget
6964

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
title: API
3+
pcx_content_type: how-to
4+
sidebar:
5+
order: 2
6+
---
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
title: Cloudflare dashboard
3+
pcx_content_type: how-to
4+
sidebar:
5+
order: 1
6+
---
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: Implementation methods
3+
pcx_content_type: get-started
4+
sidebar:
5+
order: 1
6+
label: Overview
7+
group:
8+
hideIndex: true
9+
---

src/content/docs/turnstile/get-started/terraform.mdx renamed to src/content/docs/turnstile/get-started/widget-management/implementation-methods/terraform.mdx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
---
2-
pcx_content_type: how-to
32
title: Terraform
3+
pcx_content_type: how-to
44
sidebar:
5-
order: 4
5+
order: 3
66
---
77

8-
:::note[Requirements]
8+
import { Render } from "~/components"
99

10+
:::note[Requirements]
1011
This guide assumes that you have the [Terraform](https://developer.hashicorp.com/terraform/tutorials/certification-associate-tutorials/install-cli) command installed on your machine.
1112
:::
1213

1314
[Terraform](https://developer.hashicorp.com/terraform/tutorials/certification-associate-tutorials/install-cli) is a tool for building, changing, and versioning infrastructure, and provides components and documentation for building [Cloudflare resources](https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs). Listed below are examples to help you get started with Turnstile using Terraform. For a more generalized guide on configuring Cloudflare and Terraform, visit our [Getting Started with Terraform and Cloudflare](https://blog.cloudflare.com/getting-started-with-terraform-and-cloudflare-part-1/) blog post.
1415

15-
## Create a Turnstile widget with Terraform
16-
1716
### Create an API token
1817

1918
Create an [API Token](/fundamentals/api/get-started/create-token/) with the **Account > Turnstile > Edit** permission. Next, you need to export this secret in our environment variables:

src/content/docs/turnstile/get-started/widget-management/index.mdx

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,32 @@ pcx_content_type: get-started
44
sidebar:
55
order: 1
66
label: Overview
7+
---
8+
9+
import { Render, LinkButton } from "~/components"
10+
11+
<Render file="widget-management-overview" />
712

813
---
914

10-
Learn how to create, configure, and manage your Turnstile widgets using the Cloudflare dashboard, API, or Terraform.
15+
## Implementation methods
1116

12-
## Overview
17+
<Render file="implementation-methods" />
18+
19+
---
1320

14-
Turnstile widgets are the foundation of your bot protection implementation.
21+
## Best practices
1522

16-
Every widget has:
23+
### Security
1724

18-
- **Sitekey**: Public identifier used in your webpage code
19-
- **Secret Key**: Private key used for server-side validation
20-
- **Configuration**: Mode, hostnames, appearance settings, and other options
25+
- **Protect secret keys**: Never expose secret keys in client-side code.
26+
- **Rotate keys regularly**: Use API or dashboard to rotate secret keys periodically.
27+
- **Restrict hostnames**: Only allow widgets on domains you control.
28+
**Monitor usage**: Use analytics to detect unusual patterns.
2129

22-
:::note[Important]
23-
Regardless of how you create and manage your widgets, you will still need to embed them on your webpage and validate tokens on your server.
24-
:::
30+
### Operational
2531

32+
- **Use descriptive names**: Name widgets based on their purpose, such as "Login Form" or "Contact Page".
33+
- **Environment separation**: Use different widgets for development, staging, and production.
34+
- **Documentation**: Keep track of which widgets are used at which locations.
35+
- **Backup configuration**: Store widget configurations in version control when using Terraform.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
{}
3+
4+
---
5+
6+
import { LinkButton } from "~/components"
7+
8+
<LinkButton href="/turnstile/get-started/widget-management/implementation-methods/dashboard/">Cloudflare dashboard</LinkButton>
9+
10+
<LinkButton href="/turnstile/get-started/widget-management/implementation-methods/api/">API</LinkButton>
11+
12+
<LinkButton href="/turnstile/get-started/widget-management/implementation-methods/terraform/">Terraform</LinkButton>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
{}
3+
4+
---
5+
6+
7+
Learn how to create, configure, and manage your Turnstile widgets using the Cloudflare dashboard, API, or Terraform.
8+
9+
## Overview
10+
11+
Turnstile widgets are the foundation of your bot protection implementation.
12+
13+
Every widget has:
14+
15+
- **Sitekey**: Public identifier used in your webpage code
16+
- **Secret Key**: Private key used for server-side validation
17+
- **Configuration**: Mode, hostnames, appearance settings, and other options
18+
19+
:::note[Important]
20+
Regardless of how you create and manage your widgets, you will still need to embed them on your webpage and validate tokens on your server.
21+
:::

0 commit comments

Comments
 (0)