MCPcopy Index your code
hub / github.com/simstudioai/sim / isTeamPlan

Function isTeamPlan

apps/sim/lib/billing/core/subscription.ts:240–259  ·  view source on GitHub ↗
(userId: string)

Source from the content-addressed store, hash-verified

238 * Check if user is on Team plan (direct or via organization)
239 */
240export async function isTeamPlan(userId: string): Promise<boolean> {
241 try {
242 if (!isBillingEnabled) {
243 return true
244 }
245
246 const subscription = await getHighestPrioritySubscription(userId)
247 const isTeam =
248 subscription && (checkTeamPlan(subscription) || checkEnterprisePlan(subscription))
249
250 if (isTeam) {
251 logger.info('User has team-level plan', { userId, plan: subscription.plan })
252 }
253
254 return !!isTeam
255 } catch (error) {
256 logger.error('Error checking team plan status', { error, userId })
257 return false
258 }
259}
260
261/**
262 * Check if user is on Enterprise plan (direct or via organization)

Callers

nothing calls this directly

Calls 5

checkTeamPlanFunction · 0.90
checkEnterprisePlanFunction · 0.90
infoMethod · 0.80
errorMethod · 0.80

Tested by

no test coverage detected