Script Constants
These constants are exported from@marsidev/react-turnstile and can be used when manually managing the Turnstile script.
SCRIPT_URL
DEFAULT_SCRIPT_ID
DEFAULT_CONTAINER_ID
DEFAULT_ONLOAD_NAME
Type Definitions
Theme Types
'auto': Respects user’s system preference (default)'light': Light theme'dark': Dark theme
Widget Size Types
'normal': 300x65px (default)'compact': 150x140px'flexible': 100% width (min: 300px) x 65px'invisible': No visible widget
Appearance Mode Types
'always': Always visible (default)'execute': Only visible when executing'interaction-only': Only visible when interactivity is required
Execution Mode Types
'render': Obtains token on render (default)'execute': Obtains token when.execute()is called
Retry Mode Types
'auto': Automatically allows retry (default)'never': Never allows retry
Refresh Mode Types
'auto': Automatically refresh (default)'manual': Prompt user with refresh button'never': Never refresh
Supported Languages
TurnstileLangCode
'en': English'es': Spanish'fr': French'de': German'ja': Japanese'zh-CN': Chinese (Simplified)'zh-TW': Chinese (Traditional)'pt-BR': Portuguese (Brazil)'ar': Arabic'hi': Hindi'ru': Russian
Container Style Constants
These constants are used internally but can be referenced:Import Examples
Import Constants
Import Types
Import All Exports
Related Types
- TurnstileProps - Component props
- ComponentRenderOptions - Render options
- ScriptOptions - Script options
- Server Validation - Validation types