We've added Cloudflare Turnstile invisible widget to the newsletter subscribe flow. The code references a placeholder site key that needs to be replaced with your real one.
Steps
- Go to Cloudflare Dashboard -> Turnstile (https://dash.cloudflare.com/?to=/:account/turnstile)
- Click "Add a widget"
- Set widget name to "devcheap newsletter"
- Set domain to "devcheap.click"
- Choose "Invisible" widget mode
- Copy the Site Key and Secret Key
Update the code
- Replace TURNSTILE_SITE_KEY in js/search.js with your real Site Key
- Add TURNSTILE_SECRET_KEY as a Cloudflare Pages secret in the Dashboard
Acceptance Criteria
Related code: js/search.js (turnstileToken, onTurnstileLoad), functions/api/subscribe.js (Turnstile validation), index.html (Turnstile CSP entries + widget container)
We've added Cloudflare Turnstile invisible widget to the newsletter subscribe flow. The code references a placeholder site key that needs to be replaced with your real one.
Steps
Update the code
Acceptance Criteria
Related code: js/search.js (turnstileToken, onTurnstileLoad), functions/api/subscribe.js (Turnstile validation), index.html (Turnstile CSP entries + widget container)