Skip to content

Scheduling infrastructure for absolutely everyone.

chore: Make URLs for terms and privacy policy customizable via .env vars (#16350)

CodeShakingSheep7a57f57e9902
diff --git a/.env.example b/.env.example
index ceacae501a4..a114365bdf1 100644
--- a/.env.example
+++ b/.env.example
@@ -362,10 +362,13 @@ TASKER_ENABLE_EMAILS=0
# Ratelimiting via unkey
UNKEY_ROOT_KEY=
-
# Used for Cal.ai Enterprise Voice AI Agents
# https://retellai.com
RETELL_AI_KEY=
# Used to disallow emails as being added as guests on bookings
BLACKLISTED_GUEST_EMAILS=
+
+# Custom privacy policy / terms URLs (for self-hosters: change to your privacy policy / terms URLs)
+NEXT_PUBLIC_WEBSITE_PRIVACY_POLICY_URL=
+NEXT_PUBLIC_WEBSITE_TERMS_URL=
diff --git a/apps/web/pages/signup.tsx b/apps/web/pages/signup.tsx
index dc499a16e7c..49015ba22af 100644
--- a/apps/web/pages/signup.tsx
+++ b/apps/web/pages/signup.tsx
@@ -23,8 +23,9 @@ import {
URL_PROTOCOL_REGEX,
IS_CALCOM,
WEBAPP_URL,
- WEBSITE_URL,
CLOUDFLARE_SITE_ID,
+ WEBSITE_PRIVACY_POLICY_URL,
+ WEBSITE_TERMS_URL,
} from "@calcom/lib/constants";
import { fetchUsername } from "@calcom/lib/fetchUsername";
import { pushGTMEvent } from "@calcom/lib/gtm";
@@ -541,14 +542,14 @@ export default function Signup({
<Link
className="text-emphasis hover:underline"
key="terms"
- href={`${WEBSITE_URL}/terms`}
+ href={`${WEBSITE_TERMS_URL}`}
target="_blank">
Terms
</Link>,
<Link
className="text-emphasis hover:underline"
key="privacy"
- href={`${WEBSITE_URL}/privacy`}
+ href={`${WEBSITE_PRIVACY_POLICY_URL}`}
target="_blank">
Privacy Policy.
</Link>,
diff --git a/packages/features/bookings/Booker/components/BookEventForm/BookEventForm.tsx b/packages/features/bookings/Booker/components/BookEventForm/BookEventForm.tsx
index 6d29abf7575..427a71e5dd1 100644
--- a/packages/features/bookings/Booker/components/BookEventForm/BookEventForm.tsx
+++ b/packages/features/bookings/Booker/components/BookEventForm/BookEventForm.tsx
@@ -5,7 +5,7 @@ import { useMemo, useState } from "react";
import type { FieldError } from "react-hook-form";
import type { BookerEvent } from "@calcom/features/bookings/types";
-import { IS_CALCOM, WEBSITE_URL } from "@calcom/lib/constants";
+import { WEBSITE_PRIVACY_POLICY_URL, WEBSITE_TERMS_URL } from "@calcom/lib/constants";
import getPaymentAppData from "@calcom/lib/getPaymentAppData";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { Alert, Button, EmptyScreen, Form } from "@calcom/ui";
@@ -118,7 +118,7 @@ export const BookEventForm = ({
/>
</div>
)}
- {!isPlatform && IS_CALCOM && (
+ {!isPlatform && (
<div className="text-subtle my-3 w-full text-xs opacity-80">
<Trans
i18nKey="signing_up_terms"
@@ -126,14 +126,14 @@ export const BookEventForm = ({
<Link
className="text-emphasis hover:underline"
key="terms"
- href={`${WEBSITE_URL}/terms`}
+ href={`${WEBSITE_TERMS_URL}`}
target="_blank">
Terms
</Link>,
<Link
className="text-emphasis hover:underline"
key="privacy"
- href={`${WEBSITE_URL}/privacy`}
+ href={`${WEBSITE_PRIVACY_POLICY_URL}`}
target="_blank">
Privacy Policy.
</Link>,
diff --git a/packages/lib/constants.ts b/packages/lib/constants.ts
index 89f8d1a3ca2..1ce361a7911 100644
--- a/packages/lib/constants.ts
+++ b/packages/lib/constants.ts
@@ -164,6 +164,10 @@ export const ORG_MINIMUM_PUBLISHED_TEAMS_SELF_SERVE = 0;
export const ORG_MINIMUM_PUBLISHED_TEAMS_SELF_SERVE_HELPER_DIALOGUE = 2;
export const CALCOM_PRIVATE_API_ROUTE = process.env.CALCOM_PRIVATE_API_ROUTE || "https://goblin.cal.com";
+export const WEBSITE_PRIVACY_POLICY_URL =
+ process.env.NEXT_PUBLIC_WEBSITE_PRIVACY_POLICY_URL || "https://cal.com/privacy";
+export const WEBSITE_TERMS_URL = process.env.NEXT_PUBLIC_WEBSITE_TERMS_URL || "https://cal.com/terms";
+
/**
* The maximum number of days we should check for if we don't find all required bookable days
* Counter start from current day and we would like to not go beyond 2 months(max days possible) from current day.
diff --git a/packages/types/environment.d.ts b/packages/types/environment.d.ts
index 9706f44b08e..3cd91be0ea2 100644
--- a/packages/types/environment.d.ts
+++ b/packages/types/environment.d.ts
@@ -58,6 +58,8 @@ declare namespace NodeJS {
readonly NEXT_PUBLIC_APP_NAME: string | "Cal";
readonly NEXT_PUBLIC_SUPPORT_MAIL_ADDRESS: string | "[email protected]";
readonly NEXT_PUBLIC_COMPANY_NAME: string | "Cal.com, Inc.";
+ readonly NEXT_PUBLIC_WEBSITE_PRIVACY_POLICY_URL: string | undefined;
+ readonly NEXT_PUBLIC_WEBSITE_TERMS_URL: string | undefined;
/**
* "strict" -> Strict CSP
* "non-strict" -> Strict CSP except the usage of unsafe-inline for `style-src`
diff --git a/turbo.json b/turbo.json
index 4275e3fc897..dc2a85b6d5b 100644
--- a/turbo.json
+++ b/turbo.json
@@ -340,6 +340,8 @@
"NEXT_PUBLIC_GTM_ID",
"NEXT_PUBLIC_ORGANIZATIONS_MIN_SELF_SERVE_SEATS",
"NEXT_PUBLIC_ORGANIZATIONS_SELF_SERVE_PRICE",
+ "NEXT_PUBLIC_WEBSITE_PRIVACY_POLICY_URL",
+ "NEXT_PUBLIC_WEBSITE_TERMS_URL",
"NEXT_RUNTIME",
"NEXTAUTH_COOKIE_DOMAIN",
"NEXTAUTH_SECRET",