You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/turnstile/get-started/index.mdx
+39-16Lines changed: 39 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,35 +20,35 @@ Before you begin, you must have:
20
20
21
21
---
22
22
23
-
## Implementation
24
-
25
-
Implementing Turnstile involves two essential components that work together:
23
+
## Process
26
24
27
-
1.**Client-side**: Embed the widget
25
+
Turnstile widgets are the foundation of your bot protection implementation.
28
26
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:
32
28
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
34
32
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
+
:::
36
36
37
-
---
37
+
Implementing Turnstile involves two essential components that work together:
38
38
39
-
## Key security requirements
39
+
1.**Client-side**: [Embed the widget](/turnstile/get-started/widget-management/client-side-rendering/)
40
40
41
-
Mandatory server-side validation
41
+
Add the Turnstile widget to your webpage to challenge visitors and generate verification tokens.
42
42
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/)
44
44
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.
46
46
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.
48
48
49
49
---
50
50
51
-
## Implementation path
51
+
## Implementation
52
52
53
53
Follow the steps below to implement Turnstile.
54
54
@@ -84,3 +84,26 @@ If you are currently using reCAPTCHA, hCaptcha, or another CAPTCHA service, Turn
84
84
85
85
Refer to [Migration](/turnstile/migration/) for step-by-step migration guidance from other CAPTCHA services.
86
86
87
+
---
88
+
89
+
## Security requirements
90
+
91
+
<Renderfile="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.
@@ -410,6 +410,4 @@ For a complete list of configuration options, refer to [Widget configurations](/
410
410
411
411
## Security requirements
412
412
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.
0 commit comments