diff --git a/.env.example b/.env.example index cb88791eb8..3d24ff316b 100644 --- a/.env.example +++ b/.env.example @@ -404,6 +404,10 @@ CAL_VIDEO_BUCKET_NAME= CAL_VIDEO_BUCKET_REGION= CAL_VIDEO_ASSUME_ROLE_ARN= +# For local testing of Daily Video +# Set this to the link of a working Daily Video meeting link +CAL_VIDEO_MEETING_LINK_FOR_TESTING= + # Used to use Replexica SDK, a tool for real-time AI-powered localization REPLEXICA_API_KEY= diff --git a/apps/web/lib/video/[uid]/getServerSideProps.ts b/apps/web/lib/video/[uid]/getServerSideProps.ts index 8e43746a72..6942c11e71 100644 --- a/apps/web/lib/video/[uid]/getServerSideProps.ts +++ b/apps/web/lib/video/[uid]/getServerSideProps.ts @@ -8,6 +8,7 @@ import { } from "@calcom/app-store/dailyvideo/lib/VideoApiAdapter"; import { getServerSession } from "@calcom/features/auth/lib/getServerSession"; import { getCalVideoReference } from "@calcom/features/get-cal-video-reference"; +import { CAL_VIDEO_MEETING_LINK_FOR_TESTING } from "@calcom/lib/constants"; import { isENVDev } from "@calcom/lib/env"; import { BookingRepository } from "@calcom/lib/server/repository/booking"; import { OrganizationRepository } from "@calcom/lib/server/repository/organization"; @@ -29,9 +30,9 @@ export async function getServerSideProps(context: GetServerSidePropsContext) { // Below if block is for local testing purposes only // STARTS------------------------------------------------------------------------------ - if (booking?.references[0] && isENVDev) { + if (booking?.references[0] && isENVDev && CAL_VIDEO_MEETING_LINK_FOR_TESTING) { // meetingUrl is `null` in dev env, so setting a dummy meetingUrl (it's a past but real meeting link in production env) - booking.references[0].meetingUrl = "https://app.cal.com/video/wvsSuNC8r9ZScPhA6JKpiL"; + booking.references[0].meetingUrl = CAL_VIDEO_MEETING_LINK_FOR_TESTING; } // ENDS-------------------------------------------------------------------------------- diff --git a/packages/lib/constants.ts b/packages/lib/constants.ts index fffc5c4408..0a8520a28a 100644 --- a/packages/lib/constants.ts +++ b/packages/lib/constants.ts @@ -210,3 +210,4 @@ export const DIRECTORY_IDS_TO_LOG = process.env.DIRECTORY_IDS_TO_LOG?.split(",") export const IS_PLAIN_CHAT_ENABLED = !!process.env.NEXT_PUBLIC_PLAIN_CHAT_ID && process.env.NEXT_PUBLIC_PLAIN_CHAT_ID !== ""; +export const CAL_VIDEO_MEETING_LINK_FOR_TESTING = process.env.CAL_VIDEO_MEETING_LINK_FOR_TESTING; diff --git a/turbo.json b/turbo.json index 0fb4b204b5..3d7a884969 100644 --- a/turbo.json +++ b/turbo.json @@ -457,6 +457,7 @@ "CAL_VIDEO_BUCKET_NAME", "CAL_VIDEO_BUCKET_REGION", "CAL_VIDEO_ASSUME_ROLE_ARN", + "CAL_VIDEO_MEETING_LINK_FOR_TESTING", "NEXT_PUBLIC_POSTHOG_KEY", "NEXT_PUBLIC_POSTHOG_HOST", "VAPID_PRIVATE_KEY",