Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions apps/web/lib/csp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ function getCspPolicy(nonce: string) {
script-src ${
IS_PRODUCTION
? // 'self' 'unsafe-inline' https: added for Browsers not supporting strict-dynamic
`'nonce-${nonce}' 'strict-dynamic' 'self' 'unsafe-inline' https:`
`'nonce-${nonce}' 'strict-dynamic' 'self' 'unsafe-inline' https: https://collector.insights.com`
: // Note: We could use 'strict-dynamic' with 'nonce-..' instead of unsafe-inline but there are some streaming related scripts that get blocked(because they don't have nonce on them). It causes a really frustrating full page error model by Next.js to show up sometimes
"'unsafe-inline' 'unsafe-eval' https: http:"
"'unsafe-inline' 'unsafe-eval' https: http: https://collector.insights.com"
};
object-src 'none';
base-uri 'none';
Expand All @@ -31,7 +31,7 @@ function getCspPolicy(nonce: string) {
} app.cal.com;
font-src 'self';
img-src 'self' ${WEBAPP_URL} https://img.youtube.com https://eu.ui-avatars.com/api/ data:;
connect-src 'self'
connect-src 'self' https://collector.insights.com${IS_PRODUCTION ? "" : " ws: wss:"}
`;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/app-store/apps.browser.generated.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const EventTypeAddonMap = {
gtm: dynamic(() => import("./gtm/components/EventTypeAppCardInterface")),
hitpay: dynamic(() => import("./hitpay/components/EventTypeAppCardInterface")),
hubspot: dynamic(() => import("./hubspot/components/EventTypeAppCardInterface")),
insihts: dynamic(() => import("./insihts/components/EventTypeAppCardInterface")),
insights: dynamic(() => import("./insights/components/EventTypeAppCardInterface")),
matomo: dynamic(() => import("./matomo/components/EventTypeAppCardInterface")),
metapixel: dynamic(() => import("./metapixel/components/EventTypeAppCardInterface")),
"mock-payment-app": dynamic(() => import("./mock-payment-app/components/EventTypeAppCardInterface")),
Expand Down
4 changes: 2 additions & 2 deletions packages/app-store/apps.keys-schemas.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { appKeysSchema as googlevideo_zod_ts } from "./googlevideo/zod";
import { appKeysSchema as gtm_zod_ts } from "./gtm/zod";
import { appKeysSchema as hitpay_zod_ts } from "./hitpay/zod";
import { appKeysSchema as hubspot_zod_ts } from "./hubspot/zod";
import { appKeysSchema as insihts_zod_ts } from "./insihts/zod";
import { appKeysSchema as insights_zod_ts } from "./insights/zod";
import { appKeysSchema as intercom_zod_ts } from "./intercom/zod";
import { appKeysSchema as jelly_zod_ts } from "./jelly/zod";
import { appKeysSchema as jitsivideo_zod_ts } from "./jitsivideo/zod";
Expand Down Expand Up @@ -68,7 +68,7 @@ export const appKeysSchemas = {
gtm: gtm_zod_ts,
hitpay: hitpay_zod_ts,
hubspot: hubspot_zod_ts,
insihts: insihts_zod_ts,
insights: insights_zod_ts,
intercom: intercom_zod_ts,
jelly: jelly_zod_ts,
jitsivideo: jitsivideo_zod_ts,
Expand Down
4 changes: 2 additions & 2 deletions packages/app-store/apps.metadata.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import horizon_workrooms_config_json from "./horizon-workrooms/config.json";
import { metadata as hubspot__metadata_ts } from "./hubspot/_metadata";
import { metadata as huddle01video__metadata_ts } from "./huddle01video/_metadata";
import ics_feedcalendar_config_json from "./ics-feedcalendar/config.json";
import insihts_config_json from "./insihts/config.json";
import insights_config_json from "./insights/config.json";
import intercom_config_json from "./intercom/config.json";
import jelly_config_json from "./jelly/config.json";
import { metadata as jitsivideo__metadata_ts } from "./jitsivideo/_metadata";
Expand Down Expand Up @@ -152,7 +152,7 @@ export const appStoreMetadata = {
hubspot: hubspot__metadata_ts,
huddle01video: huddle01video__metadata_ts,
"ics-feedcalendar": ics_feedcalendar_config_json,
insihts: insihts_config_json,
insights: insights_config_json,
intercom: intercom_config_json,
jelly: jelly_config_json,
jitsivideo: jitsivideo__metadata_ts,
Expand Down
4 changes: 2 additions & 2 deletions packages/app-store/apps.schemas.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { appDataSchema as googlevideo_zod_ts } from "./googlevideo/zod";
import { appDataSchema as gtm_zod_ts } from "./gtm/zod";
import { appDataSchema as hitpay_zod_ts } from "./hitpay/zod";
import { appDataSchema as hubspot_zod_ts } from "./hubspot/zod";
import { appDataSchema as insihts_zod_ts } from "./insihts/zod";
import { appDataSchema as insights_zod_ts } from "./insights/zod";
import { appDataSchema as intercom_zod_ts } from "./intercom/zod";
import { appDataSchema as jelly_zod_ts } from "./jelly/zod";
import { appDataSchema as jitsivideo_zod_ts } from "./jitsivideo/zod";
Expand Down Expand Up @@ -68,7 +68,7 @@ export const appDataSchemas = {
gtm: gtm_zod_ts,
hitpay: hitpay_zod_ts,
hubspot: hubspot_zod_ts,
insihts: insihts_zod_ts,
insights: insights_zod_ts,
intercom: intercom_zod_ts,
jelly: jelly_zod_ts,
jitsivideo: jitsivideo_zod_ts,
Expand Down
2 changes: 1 addition & 1 deletion packages/app-store/apps.server.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const apiHandlers = {
hubspot: import("./hubspot/api"),
huddle01video: import("./huddle01video/api"),
"ics-feedcalendar": import("./ics-feedcalendar/api"),
insihts: import("./insihts/api"),
insights: import("./insights/api"),
intercom: import("./intercom/api"),
jelly: import("./jelly/api"),
jitsivideo: import("./jitsivideo/api"),
Expand Down
4 changes: 2 additions & 2 deletions packages/app-store/bookerApps.metadata.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { metadata as googlevideo__metadata_ts } from "./googlevideo/_metadata";
import gtm_config_json from "./gtm/config.json";
import horizon_workrooms_config_json from "./horizon-workrooms/config.json";
import { metadata as huddle01video__metadata_ts } from "./huddle01video/_metadata";
import insihts_config_json from "./insihts/config.json";
import insights_config_json from "./insights/config.json";
import jelly_config_json from "./jelly/config.json";
import { metadata as jitsivideo__metadata_ts } from "./jitsivideo/_metadata";
import matomo_config_json from "./matomo/config.json";
Expand Down Expand Up @@ -61,7 +61,7 @@ export const appStoreMetadata = {
gtm: gtm_config_json,
"horizon-workrooms": horizon_workrooms_config_json,
huddle01video: huddle01video__metadata_ts,
insihts: insihts_config_json,
insights: insights_config_json,
jelly: jelly_config_json,
jitsivideo: jitsivideo__metadata_ts,
matomo: matomo_config_json,
Expand Down
84 changes: 19 additions & 65 deletions packages/app-store/index.ts
Original file line number Diff line number Diff line change
@@ -1,67 +1,21 @@
const appStore = {
alby: createCachedImport(() => import("./alby")),
applecalendar: createCachedImport(() => import("./applecalendar")),
caldavcalendar: createCachedImport(() => import("./caldavcalendar")),
closecom: createCachedImport(() => import("./closecom")),
dailyvideo: createCachedImport(() => import("./dailyvideo")),
dub: createCachedImport(() => import("./dub")),
googlecalendar: createCachedImport(() => import("./googlecalendar")),
googlevideo: createCachedImport(() => import("./googlevideo")),
hubspot: createCachedImport(() => import("./hubspot")),
huddle01video: createCachedImport(() => import("./huddle01video")),
"ics-feedcalendar": createCachedImport(() => import("./ics-feedcalendar")),
jellyconferencing: createCachedImport(() => import("./jelly")),
jitsivideo: createCachedImport(() => import("./jitsivideo")),
larkcalendar: createCachedImport(() => import("./larkcalendar")),
nextcloudtalkvideo: createCachedImport(() => import("./nextcloudtalk")),
office365calendar: createCachedImport(() => import("./office365calendar")),
office365video: createCachedImport(() => import("./office365video")),
plausible: createCachedImport(() => import("./plausible")),
paypal: createCachedImport(() => import("./paypal")),
"pipedrive-crm": createCachedImport(() => import("./pipedrive-crm")),
salesforce: createCachedImport(() => import("./salesforce")),
zohocrm: createCachedImport(() => import("./zohocrm")),
sendgrid: createCachedImport(() => import("./sendgrid")),
stripepayment: createCachedImport(() => import("./stripepayment")),
tandemvideo: createCachedImport(() => import("./tandemvideo")),
vital: createCachedImport(() => import("./vital")),
zoomvideo: createCachedImport(() => import("./zoomvideo")),
wipemycalother: createCachedImport(() => import("./wipemycalother")),
webexvideo: createCachedImport(() => import("./webex")),
giphy: createCachedImport(() => import("./giphy")),
zapier: createCachedImport(() => import("./zapier")),
make: createCachedImport(() => import("./make")),
exchange2013calendar: createCachedImport(() => import("./exchange2013calendar")),
exchange2016calendar: createCachedImport(() => import("./exchange2016calendar")),
exchangecalendar: createCachedImport(() => import("./exchangecalendar")),
facetime: createCachedImport(() => import("./facetime")),
sylapsvideo: createCachedImport(() => import("./sylapsvideo")),
zohocalendar: createCachedImport(() => import("./zohocalendar")),
"zoho-bigin": createCachedImport(() => import("./zoho-bigin")),
basecamp3: createCachedImport(() => import("./basecamp3")),
telegramvideo: createCachedImport(() => import("./telegram")),
shimmervideo: createCachedImport(() => import("./shimmervideo")),
hitpay: createCachedImport(() => import("./hitpay")),
btcpayserver: createCachedImport(() => import("./btcpayserver")),
};
/**
* Cal.com App Store - Optimized for Performance
*
* This module provides lazy loading for Cal.com apps to improve development
* performance. Instead of loading all 100+ apps upfront, apps are loaded
* on-demand when actually needed.
*
* IMPLEMENTATION CHANGE: This replaces the previous monolithic app store with
* a lazy loading system that reduces initial bundle size significantly.
*
* Backward compatibility is maintained via a compatibility proxy, though
* new code should prefer the named utilities (loadApp, hasApp, etc.).
*/
import { lazyAppStore } from "./lazy-loader";

function createCachedImport<T>(importFunc: () => Promise<T>): () => Promise<T> {
let cachedModule: T | undefined;
// Export the lazy app store as the default export
// This maintains backward compatibility with existing imports
export default lazyAppStore;

return async () => {
if (!cachedModule) {
cachedModule = await importFunc();
}
return cachedModule;
};
}

const exportedAppStore: typeof appStore & {
["mock-payment-app"]?: () => Promise<typeof import("./mock-payment-app/index")>;
} = appStore;

if (process.env.MOCK_PAYMENT_APP_ENABLED !== undefined) {
exportedAppStore["mock-payment-app"] = createCachedImport(() => import("./mock-payment-app/index"));
}

export default exportedAppStore;
// Re-export utilities for direct usage
export { loadApp, hasApp, getAvailableApps, preloadApps, clearAppCache } from "./lazy-loader";
31 changes: 31 additions & 0 deletions packages/app-store/insights/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"name": "Insights",
"slug": "insights",
"type": "insights_analytics",
"logo": "icon.svg",
"url": "https://cal.com/",
"variant": "analytics",
"categories": ["analytics"],
"publisher": "Cal.com, Inc.",
"email": "help@cal.com",
"description": "Insights is an all-in-one platform for businesses looking to track user behavior, optimize workflows, and make data-driven decisions. Whether you are a marketer, product manager, or part of a customer success team, Insights provides the tools you need to succeed.",
"extendsFeature": "EventType",
"appData": {
"tag": {
"scripts": [
{
"src": "https://collector.insights.com/script.js",
"attrs": {
"defer": true,
"crossorigin": "anonymous",
"referrerpolicy": "strict-origin-when-cross-origin",
"data-website-id": "{SITE_ID}"
}
}
]
}
},
"isTemplate": false,
"__createdUsingCli": true,
"__template": "booking-pages-tag"
}
14 changes: 14 additions & 0 deletions packages/app-store/insights/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "https://json.schemastore.org/package.json",
"private": true,
"name": "@calcom/insights",
"version": "0.0.0",
"main": "./index.ts",
"dependencies": {
"@calcom/lib": "*"
},
"devDependencies": {
"@calcom/types": "*"
},
"description": "Insights is an all-in-one platform for businesses looking to track user behavior, optimize workflows, and make data-driven decisions. Whether you are a marketer, product manager, or part of a customer success team, Insights provides the tools you need to succeed."
}
28 changes: 0 additions & 28 deletions packages/app-store/insihts/config.json

This file was deleted.

14 changes: 0 additions & 14 deletions packages/app-store/insihts/package.json

This file was deleted.

Loading
Loading