Cloudflare Turnstile
How to integrate Cloudflare Turnstile in your application.
Sign in to Cloudflare
Go into Cloudflare and sign in.
Add a domain
Select Add a domain button and add your domain.
Follow the instructions to add your domain. If you have any trouble, you can check the Cloudflare documentation.
Configure the widget
Configure the widget to your needs. We support all the mods that Cloudflare provides like Managed, Non-interactive and Invisible.
Remember to add your hostname to the Hostname Management list.
Get the Site Key & Secret Key
After you create the widget, you will get the Site Key and Secret Key. Save it, You will need these keys to integrate the widget into your application.
Add keys to .env
Add the keys to your .env file.
CLOUDFLARE_TURNSTILE_SITE_KEY=XXX
CLOUDFLARE_TURNSTILE_SECRET_KEY=XXXProvide keys to VitNode
import { buildApiConfig } from '@vitnode/core/vitnode.config';
export const vitNodeApiConfig = buildApiConfig({
captcha: {
type: 'cloudflare_turnstile',
siteKey: process.env.CLOUDFLARE_TURNSTILE_SITE_KEY,
secretKey: process.env.CLOUDFLARE_TURNSTILE_SECRET_KEY,
},
});