{"record":{"id":"2e181c9fedc7a529","repo":"calcom/cal.diy","slug":"delegation-credentials-are-not-available-in-the-co","errorCode":null,"errorMessage":"Delegation credentials are not available in the community edition","messagePattern":"Delegation credentials are not available in the community edition","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"packages/app-store/delegationCredential.ts","lineNumber":31,"sourceCode":"}) {\n  return [] as CredentialForCalendarService[];\n}\n\nexport async function getAllDelegationCredentialsForUser(_args: { user: { email: string; id: number } }) {\n  return [] as CredentialForCalendarService[];\n}\n\nexport async function getAllDelegatedCalendarCredentialsForUser(_args: {\n  user: { email: string; id: number };\n}) {\n  return [] as CredentialForCalendarService[];\n}\n\nexport async function assertSuccessfullyConfiguredInWorkspace(_args: {\n  delegationCredential: unknown;\n  user: unknown;\n}): Promise<void> {\n  throw new Error(\"Delegation credentials are not available in the community edition\");\n}\n\nexport async function getAllDelegationCredentialsForUserByAppType(_args: {\n  user: { email: string; id: number };\n  appType: string;\n}) {\n  return [] as CredentialForCalendarService[];\n}\n\nexport async function getAllDelegationCredentialsForUserByAppSlug(_args: {\n  user: { email: string; id: number };\n  appSlug: string;\n}) {\n  return [] as CredentialForCalendarService[];\n}\n\nexport const buildAllCredentials = ({\n  existingCredentials,","sourceCodeStart":13,"sourceCodeEnd":49,"githubUrl":"https://github.com/calcom/cal.diy/blob/176037d0afbe572f870a3c702985e7cd83fe6c0c/packages/app-store/delegationCredential.ts#L13-L49","documentation":"Thrown unconditionally by assertSuccessfullyConfiguredInWorkspace in the community-edition stub of delegationCredential.ts. The community build ships no-op stubs for every delegation-credential function; this one cannot no-op (it must assert configuration) so it always throws, signaling the feature is enterprise-only.","triggerScenarios":"Any code path in community edition that calls assertSuccessfullyConfiguredInWorkspace({ delegationCredential, user }) — typically the workspace/org calendar delegation setup flow.","commonSituations":"Running Cal.com community edition and trying to configure Google Workspace Calendar delegation or Microsoft Graph calendar delegation for an organization; calling an EE-only API surface from community code.","solutions":["If you need delegation credentials, run the enterprise edition or acquire an EE license.","If you are building a feature, gate the UI/API that calls assertSuccessfullyConfiguredInWorkspace behind an EE check so community users never reach it.","If this is unexpected in EE, verify the correct (EE) implementation of delegationCredential.ts is being resolved by the module system instead of this community stub."],"exampleFix":"// before - community stub always throws\nexport async function assertSuccessfullyConfiguredInWorkspace(_args) {\n  throw new Error(\"Delegation credentials are not available in the community edition\");\n}\n\n// after - guard caller so the stub is never reached in community\nif (!isEnterprise()) {\n  throw new TRPCError({ code: \"FORBIDDEN\", message: \"Delegation credentials require Cal.com Enterprise.\" });\n}\nawait assertSuccessfullyConfiguredInWorkspace({ delegationCredential, user });","handlingStrategy":"type-guard","validationCode":"import { isEnterprise } from \"@calcom/ee/lib/isEnterprise\";\nif (!isEnterprise()) {\n  throw new TRPCError({ code: \"FORBIDDEN\", message: \"Delegation credentials require Cal.com Enterprise.\" });\n}","typeGuard":"const supportsDelegationCredentials = (): boolean => {\n  // community stub throws; EE does not. Feature-flag this at the UI layer.\n  try { return typeof process.env.CALCOM_LICENSE !== \"undefined\"; } catch { return false; }\n}","tryCatchPattern":"try {\n  await assertSuccessfullyConfiguredInWorkspace({ delegationCredential, user });\n} catch (err) {\n  if (err instanceof Error && /community edition/i.test(err.message)) {\n    res.status(403).json({ error: \"This feature requires Cal.com Enterprise.\" });\n    return;\n  }\n  throw err;\n}","preventionTips":["Gate delegation-credential UI behind an enterprise feature flag.","Document which routes are enterprise-only so community users never reach the stub.","In EE, verify the correct (non-stub) delegationCredential module resolves."],"tags":["enterprise","delegation-credentials","feature-gate","community-edition"],"backgroundTag":null,"analyzedSha":"176037d0afbe572f870a3c702985e7cd83fe6c0c","analyzedAt":"2026-08-12T19:12:41.464Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}