2023-03-20 11:16:46 +00:00
|
|
|
const VERCEL_URL = process.env.NEXT_PUBLIC_VERCEL_URL ? `https://${process.env.NEXT_PUBLIC_VERCEL_URL}` : "";
|
2022-07-07 01:13:02 +00:00
|
|
|
const RAILWAY_STATIC_URL = process.env.RAILWAY_STATIC_URL ? `https://${process.env.RAILWAY_STATIC_URL}` : "";
|
|
|
|
const HEROKU_URL = process.env.HEROKU_APP_NAME ? `https://${process.env.HEROKU_APP_NAME}.herokuapp.com` : "";
|
2023-01-07 10:28:02 +00:00
|
|
|
const RENDER_URL = process.env.RENDER_EXTERNAL_URL ? `https://${process.env.RENDER_EXTERNAL_URL}` : "";
|
2023-08-10 16:32:20 +00:00
|
|
|
export const CALCOM_ENV = process.env.CALCOM_ENV || process.env.NODE_ENV;
|
|
|
|
export const IS_PRODUCTION = CALCOM_ENV === "production";
|
2023-08-22 13:07:32 +00:00
|
|
|
export const IS_PRODUCTION_BUILD = process.env.NODE_ENV === "production";
|
2023-07-19 07:15:05 +00:00
|
|
|
|
2023-09-21 21:08:34 +00:00
|
|
|
/** https://app.cal.com */
|
2022-07-07 01:13:02 +00:00
|
|
|
export const WEBAPP_URL =
|
2023-01-04 22:14:46 +00:00
|
|
|
process.env.NEXT_PUBLIC_WEBAPP_URL ||
|
|
|
|
VERCEL_URL ||
|
|
|
|
RAILWAY_STATIC_URL ||
|
|
|
|
HEROKU_URL ||
|
2023-01-07 10:28:02 +00:00
|
|
|
RENDER_URL ||
|
2023-01-04 22:14:46 +00:00
|
|
|
"http://localhost:3000";
|
2023-07-19 07:15:05 +00:00
|
|
|
|
|
|
|
// OAuth needs to have HTTPS(which is not generally setup locally) and a valid tld(*.local isn't a valid tld)
|
|
|
|
// So for development purpose, we would stick to localhost only
|
|
|
|
export const WEBAPP_URL_FOR_OAUTH = IS_PRODUCTION ? WEBAPP_URL : "http://localhost:3000";
|
|
|
|
|
2022-03-26 00:39:38 +00:00
|
|
|
/** @deprecated use `WEBAPP_URL` */
|
|
|
|
export const BASE_URL = WEBAPP_URL;
|
|
|
|
export const WEBSITE_URL = process.env.NEXT_PUBLIC_WEBSITE_URL || "https://cal.com";
|
2022-11-30 21:52:56 +00:00
|
|
|
export const APP_NAME = process.env.NEXT_PUBLIC_APP_NAME || "Cal.com";
|
|
|
|
export const SUPPORT_MAIL_ADDRESS = process.env.NEXT_PUBLIC_SUPPORT_MAIL_ADDRESS || "help@cal.com";
|
|
|
|
export const COMPANY_NAME = process.env.NEXT_PUBLIC_COMPANY_NAME || "Cal.com, Inc.";
|
2022-12-12 11:00:15 +00:00
|
|
|
export const SENDER_ID = process.env.NEXT_PUBLIC_SENDER_ID || "Cal";
|
2023-01-18 14:32:39 +00:00
|
|
|
export const SENDER_NAME = process.env.NEXT_PUBLIC_SENDGRID_SENDER_NAME || "Cal.com";
|
2022-05-30 07:57:48 +00:00
|
|
|
|
|
|
|
// This is the URL from which all Cal Links and their assets are served.
|
|
|
|
// Use website URL to make links shorter(cal.com and not app.cal.com)
|
|
|
|
// As website isn't setup for preview environments, use the webapp url instead
|
|
|
|
export const CAL_URL = new URL(WEBAPP_URL).hostname.endsWith(".vercel.app") ? WEBAPP_URL : WEBSITE_URL;
|
|
|
|
|
2023-07-10 14:10:30 +00:00
|
|
|
export const IS_CALCOM =
|
|
|
|
WEBAPP_URL &&
|
|
|
|
(new URL(WEBAPP_URL).hostname.endsWith("cal.com") ||
|
|
|
|
new URL(WEBAPP_URL).hostname.endsWith("cal.dev") ||
|
2023-07-26 16:15:37 +00:00
|
|
|
new URL(WEBAPP_URL).hostname.endsWith("cal.qa") ||
|
2023-07-10 14:10:30 +00:00
|
|
|
new URL(WEBAPP_URL).hostname.endsWith("cal-staging.com"));
|
|
|
|
|
2022-06-02 19:49:12 +00:00
|
|
|
export const CONSOLE_URL =
|
2023-07-11 21:21:30 +00:00
|
|
|
new URL(WEBAPP_URL).hostname.endsWith(".cal.dev") ||
|
2023-07-26 16:15:37 +00:00
|
|
|
new URL(WEBAPP_URL).hostname.endsWith(".cal.qa") ||
|
2023-07-11 21:21:30 +00:00
|
|
|
new URL(WEBAPP_URL).hostname.endsWith(".cal-staging.com") ||
|
|
|
|
process.env.NODE_ENV !== "production"
|
2022-06-02 19:49:12 +00:00
|
|
|
? `https://console.cal.dev`
|
|
|
|
: `https://console.cal.com`;
|
2022-07-06 19:31:07 +00:00
|
|
|
export const IS_SELF_HOSTED = !(
|
2022-07-11 23:46:47 +00:00
|
|
|
new URL(WEBAPP_URL).hostname.endsWith(".cal.dev") || new URL(WEBAPP_URL).hostname.endsWith(".cal.com")
|
2022-07-06 19:31:07 +00:00
|
|
|
);
|
2022-05-06 15:56:26 +00:00
|
|
|
export const EMBED_LIB_URL = process.env.NEXT_PUBLIC_EMBED_LIB_URL || `${WEBAPP_URL}/embed/embed.js`;
|
2022-03-09 22:56:05 +00:00
|
|
|
export const TRIAL_LIMIT_DAYS = 14;
|
2023-01-13 23:51:37 +00:00
|
|
|
|
|
|
|
export const HOSTED_CAL_FEATURES = process.env.NEXT_PUBLIC_HOSTED_CAL_FEATURES || !IS_SELF_HOSTED;
|
|
|
|
|
2022-03-26 00:39:38 +00:00
|
|
|
/** @deprecated use `WEBAPP_URL` */
|
|
|
|
export const NEXT_PUBLIC_BASE_URL = process.env.NEXT_PUBLIC_WEBAPP_URL || `https://${process.env.VERCEL_URL}`;
|
2022-08-08 19:39:51 +00:00
|
|
|
export const LOGO = "/calcom-logo-white-word.svg";
|
2022-07-01 17:19:52 +00:00
|
|
|
export const LOGO_ICON = "/cal-com-icon-white.svg";
|
2023-09-05 17:56:02 +00:00
|
|
|
export const AVATAR_FALLBACK = "/avatar.svg";
|
2023-05-30 16:31:49 +00:00
|
|
|
export const FAVICON_16 = "/favicon-16x16.png";
|
|
|
|
export const FAVICON_32 = "/favicon-32x32.png";
|
|
|
|
export const APPLE_TOUCH_ICON = "/apple-touch-icon.png";
|
|
|
|
export const MSTILE_ICON = "/mstile-150x150.png";
|
|
|
|
export const ANDROID_CHROME_ICON_192 = "/android-chrome-192x192.png";
|
|
|
|
export const ANDROID_CHROME_ICON_256 = "/android-chrome-256x256.png";
|
2022-07-01 17:19:52 +00:00
|
|
|
export const ROADMAP = "https://cal.com/roadmap";
|
2022-08-17 09:07:19 +00:00
|
|
|
export const DESKTOP_APP_LINK = "https://cal.com/download";
|
2023-07-04 22:11:10 +00:00
|
|
|
export const JOIN_DISCORD = "https://go.cal.com/discord";
|
2022-08-05 18:44:30 +00:00
|
|
|
export const POWERED_BY_URL = `${WEBSITE_URL}/?utm_source=embed&utm_medium=powered-by-button`;
|
2023-03-17 23:42:27 +00:00
|
|
|
export const DOCS_URL = "https://cal.com/docs";
|
2022-08-22 20:56:55 +00:00
|
|
|
export const DEVELOPER_DOCS = "https://developer.cal.com";
|
2022-07-01 17:19:52 +00:00
|
|
|
export const SEO_IMG_DEFAULT = `${WEBSITE_URL}/og-image.png`;
|
2022-12-13 21:22:38 +00:00
|
|
|
// The Dynamic OG Image is passed through Next's Image API to further optimize it.
|
|
|
|
// This results in a 80% smaller image 🤯. It is however important that for the query
|
|
|
|
// parameters you pass to the /api/social/og/image endpoint, you wrap them in encodeURIComponent
|
|
|
|
// as well, otherwise the URL won't be valid.
|
|
|
|
export const SEO_IMG_OGIMG = `${CAL_URL}/_next/image?w=1200&q=100&url=${encodeURIComponent(
|
|
|
|
"/api/social/og/image"
|
|
|
|
)}`;
|
2022-07-01 17:19:52 +00:00
|
|
|
export const SEO_IMG_OGIMG_VIDEO = `${WEBSITE_URL}/video-og-image.png`;
|
2022-11-10 20:23:56 +00:00
|
|
|
export const IS_STRIPE_ENABLED = !!(
|
|
|
|
process.env.STRIPE_CLIENT_ID &&
|
|
|
|
process.env.NEXT_PUBLIC_STRIPE_PUBLIC_KEY &&
|
|
|
|
process.env.STRIPE_PRIVATE_KEY
|
|
|
|
);
|
2022-11-18 18:59:01 +00:00
|
|
|
/** Self hosted shouldn't checkout when creating teams unless required */
|
|
|
|
export const IS_TEAM_BILLING_ENABLED = IS_STRIPE_ENABLED && (!IS_SELF_HOSTED || HOSTED_CAL_FEATURES);
|
2023-03-21 10:43:07 +00:00
|
|
|
export const FULL_NAME_LENGTH_MAX_LIMIT = 50;
|
2023-04-13 19:55:26 +00:00
|
|
|
export const MINUTES_TO_BOOK = process.env.NEXT_PUBLIC_MINUTES_TO_BOOK || "5";
|
2023-06-27 20:32:19 +00:00
|
|
|
|
|
|
|
// Needed for orgs
|
|
|
|
export const ALLOWED_HOSTNAMES = JSON.parse(`[${process.env.ALLOWED_HOSTNAMES || ""}]`) as string[];
|
|
|
|
export const RESERVED_SUBDOMAINS = JSON.parse(`[${process.env.RESERVED_SUBDOMAINS || ""}]`) as string[];
|
2023-08-03 19:17:57 +00:00
|
|
|
|
|
|
|
export const ORGANIZATION_MIN_SEATS = 30;
|
2023-08-23 09:08:14 +00:00
|
|
|
|
|
|
|
// Needed for emails in E2E
|
|
|
|
export const IS_MAILHOG_ENABLED = process.env.E2E_TEST_MAILHOG_ENABLED === "1";
|
2023-08-22 12:34:55 +00:00
|
|
|
export const CALCOM_VERSION = process.env.NEXT_PUBLIC_CALCOM_VERSION as string;
|
2023-09-20 18:01:54 +00:00
|
|
|
|
|
|
|
export const APP_CREDENTIAL_SHARING_ENABLED =
|
|
|
|
process.env.CALCOM_WEBHOOK_SECRET && process.env.CALCOM_APP_CREDENTIAL_ENCRYPTION_KEY;
|