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

Function isProPlan

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

Source from the content-addressed store, hash-verified

211 * Check if user is on Pro plan (direct or via organization)
212 */
213export async function isProPlan(userId: string): Promise<boolean> {
214 try {
215 if (!isBillingEnabled) {
216 return true
217 }
218
219 const subscription = await getHighestPrioritySubscription(userId)
220 const isPro =
221 subscription &&
222 (checkProPlan(subscription) ||
223 checkTeamPlan(subscription) ||
224 checkEnterprisePlan(subscription))
225
226 if (isPro) {
227 logger.info('User has pro-level plan', { userId, plan: subscription.plan })
228 }
229
230 return !!isPro
231 } catch (error) {
232 logger.error('Error checking pro plan status', { error, userId })
233 return false
234 }
235}
236
237/**
238 * Check if user is on Team plan (direct or via organization)

Callers 1

handleAbandonedCheckoutFunction · 0.90

Calls 6

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

Tested by

no test coverage detected