diff --git a/libs/cdd-types/src/lib/utils.ts b/libs/cdd-types/src/lib/utils.ts index 2227f81..06f1048 100644 --- a/libs/cdd-types/src/lib/utils.ts +++ b/libs/cdd-types/src/lib/utils.ts @@ -28,4 +28,7 @@ export const addressZ = extendApi( } ); -export const hCaptcha = z.string().nonempty("hCaptcha validation token is required"); \ No newline at end of file +export const hCaptcha = + process.env['HCAPTCHA_IS_ENABLED'] === 'true' + ? z.string().nonempty('hCaptcha validation token is required') + : z.optional(z.string());