Captcha
Captcha Site Keys
Section titled “Captcha Site Keys”Use layer captcha sitekeys after a direct Cloudflare deploy to read Captcha
site keys from the current project and local deployment state.
layer captcha sitekeys [project] [options]The command reads the current app, finds Captcha sitekey bindings, and prints
the public site key for each configured Captcha instance. Managed Cloudflare
Turnstile site keys come from the local deployment state that layer deploy cloudflare records after Cloudflare creates the widget. Google reCAPTCHA and
adopted Turnstile site keys come from the explicit sitekey in app code.
The output includes public site keys only.
Options
Section titled “Options”| Option | Value | Notes |
|---|---|---|
--env | <name> | Local state scope name. Defaults to default. |
--namespace | <name> | Captcha namespace filter. |
--name | <name> | Captcha instance name filter. |
--json | Print JSON records. | |
-h, --help | Show help. |
Examples
Section titled “Examples”Print all Captcha site keys for the default environment:
layer captcha sitekeysPrint the site key for the production signup Captcha:
layer captcha sitekeys --env production --name signupPrint JSON for a frontend build script:
layer captcha sitekeys --env production --jsonOutput Fields
Section titled “Output Fields”| Field | Meaning |
|---|---|
namespace | Captcha namespace. |
name | Captcha instance name. |
provider | Captcha provider. |
bindingName | Worker environment binding name. |
sitekey | Public site key when the key is ready. |
source | The source used to resolve the site key. |
state | ready when a site key is available, or pending when a managed widget has not been deployed yet. |
Pending Managed Widgets
Section titled “Pending Managed Widgets”(deploy pending) means the current app declares a managed Turnstile widget
and the local deployment state is waiting for the Cloudflare-generated site
key. Run layer deploy for that environment and rerun layer captcha sitekeys.