MCPcopy Create free account
hub / github.com/freecodexyz/free-code / isOverageProvisioningAllowed

Function isOverageProvisioningAllowed

src/utils/auth.ts:1691–1711  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1689 * This mirrors the logic in apps/claude-ai `useIsOverageProvisioningAllowed` hook as closely as possible.
1690 */
1691export function isOverageProvisioningAllowed(): boolean {
1692 const accountInfo = getOauthAccountInfo()
1693 const billingType = accountInfo?.billingType
1694
1695 // Must be a Claude subscriber with a supported subscription type
1696 if (!isClaudeAISubscriber() || !billingType) {
1697 return false
1698 }
1699
1700 // only allow Stripe and mobile billing types to purchase extra usage
1701 if (
1702 billingType !== 'stripe_subscription' &&
1703 billingType !== 'stripe_subscription_contracted' &&
1704 billingType !== 'apple_subscription' &&
1705 billingType !== 'google_play_subscription'
1706 ) {
1707 return false
1708 }
1709
1710 return true
1711}
1712
1713// Returns whether the user has Opus access at all, regardless of whether they
1714// are a subscriber or PayG.

Callers 2

isExtraUsageAllowedFunction · 0.85
getWarningUpsellTextFunction · 0.85

Calls 2

getOauthAccountInfoFunction · 0.70
isClaudeAISubscriberFunction · 0.70

Tested by

no test coverage detected