Skip to content

Commit 27fa98e

Browse files
updates
1 parent 7cf90c0 commit 27fa98e

File tree

12 files changed

+135
-508
lines changed

12 files changed

+135
-508
lines changed

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

Lines changed: 39 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,35 +20,35 @@ Before you begin, you must have:
2020

2121
---
2222

23-
## Implementation
24-
25-
Implementing Turnstile involves two essential components that work together:
23+
## Process
2624

27-
1. **Client-side**: Embed the widget
25+
Turnstile widgets are the foundation of your bot protection implementation.
2826

29-
Add the Turnstile widget to your webpage to challenge visitors and generate verification tokens.
30-
31-
2. **Server-side**: Validate the response
27+
Every widget has:
3228

33-
Verify the tokens on your server using the Siteverify API to ensure they are authentic and have not been tampered with.
29+
- **Sitekey**: Public identifier used in your webpage code
30+
- **Secret Key**: Private key used for server-side validation
31+
- **Configuration**: Mode, hostnames, appearance settings, and other options
3432

35-
Refer to [Implementation path](/turnstile/get-started/#implementation-path) below for guidance on how to implement Turnstile to your website.
33+
:::note[Important]
34+
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.
35+
:::
3636

37-
---
37+
Implementing Turnstile involves two essential components that work together:
3838

39-
## Key security requirements
39+
1. **Client-side**: [Embed the widget](/turnstile/get-started/widget-management/client-side-rendering/)
4040

41-
Mandatory server-side validation
41+
Add the Turnstile widget to your webpage to challenge visitors and generate verification tokens.
4242

43-
- It is critical to enforce Turnstile tokens with the Siteverify API. The Turnstile token could be invalid, expired, or already redeemed. Not verifying the token will leave major vulnerabilities in your implementation. You must call Siteverify to complete your Turnstile configuration. Otherwise, it is incomplete and will result in zeroes for token validation when viewing your metrics in [Turnstile Analytics](/turnstile/turnstile-analytics/).
43+
2. **Server-side**: [Validate the response](/turnstile/get-started/widget-management/server-side-validation/)
4444

45-
Token lifecycle
45+
Verify the tokens on your server using the Siteverify API to ensure they are authentic and have not been tampered with.
4646

47-
- Tokens expire after 300 seconds (5 minutes). Each token can only be validated once. Expired or used tokens must be replaced with fresh challenges.
47+
Refer to [Implementation path](/turnstile/get-started/#implementation-path) below for guidance on how to implement Turnstile to your website.
4848

4949
---
5050

51-
## Implementation path
51+
## Implementation
5252

5353
Follow the steps below to implement Turnstile.
5454

@@ -84,3 +84,26 @@ If you are currently using reCAPTCHA, hCaptcha, or another CAPTCHA service, Turn
8484

8585
Refer to [Migration](/turnstile/migration/) for step-by-step migration guidance from other CAPTCHA services.
8686

87+
---
88+
89+
## Security requirements
90+
91+
<Render file="security-requirements" />
92+
93+
---
94+
95+
## Best practices
96+
97+
### Security
98+
99+
- **Protect secret keys**: Never expose secret keys in client-side code.
100+
- **Rotate keys regularly**: Use API or dashboard to rotate secret keys periodically.
101+
- **Restrict hostnames**: Only allow widgets on domains you control.
102+
**Monitor usage**: Use analytics to detect unusual patterns.
103+
104+
### Operational
105+
106+
- **Use descriptive names**: Name widgets based on their purpose, such as "Login Form" or "Contact Page".
107+
- **Environment separation**: Use different widgets for development, staging, and production.
108+
- **Documentation**: Keep track of which widgets are used at which locations.
109+
- **Backup configuration**: Store widget configurations in version control when using Terraform.

src/content/docs/turnstile/get-started/widget-management/client-side-rendering.mdx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Embed the widget
33
pcx_content_type: get-started
44
sidebar:
5-
order: 2
5+
order: 3
66
---
77

88
import { Render, Tabs, TabItem, Steps, Details } from "~/components";
@@ -410,6 +410,4 @@ For a complete list of configuration options, refer to [Widget configurations](/
410410

411411
## Security requirements
412412

413-
- Server-side validation is critical. The client-side widget alone does not provide security. You must validate tokens on your server using the Siteverify API. The token could be invalid, forged, expired (tokens expire after 5 minutes), or already redeemed (tokens can only be used once).
414-
415-
- Tokens are created when challenges are completed. Tokens expire after 300 seconds (5 minutes). Each token can only be validated once. By default, expired tokens are automatically refreshed.
413+
<Render file="security-requirements" />

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
2-
title: Implementation methods
2+
title: Implement the widget
33
pcx_content_type: get-started
44
sidebar:
5-
order: 1
5+
order: 2
66
label: Overview
77
group:
88
hideIndex: true

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

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,12 @@ pcx_content_type: get-started
44
sidebar:
55
order: 1
66
label: Overview
7+
group:
8+
hideIndex: true
79
---
810

9-
import { Render, LinkButton } from "~/components"
11+
import { DirectoryListing } from "~/components"
1012

11-
<Render file="widget-management-overview" />
13+
Refer to the following pages for more information about managing Turnstile widgets:
1214

13-
---
14-
15-
## Implementation methods
16-
17-
<Render file="implementation-methods" />
18-
19-
---
20-
21-
## Best practices
22-
23-
### Security
24-
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.
29-
30-
### Operational
31-
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.
15+
<DirectoryListing />

0 commit comments

Comments
 (0)