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

Function isOverageProvisioningAllowed

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

Source from the content-addressed store, hash-verified

1896 * This mirrors the logic in apps/claude-ai `useIsOverageProvisioningAllowed` hook as closely as possible.
1897 */
1898export function isOverageProvisioningAllowed(): boolean {
1899 const accountInfo = getOauthAccountInfo()
1900 const billingType = accountInfo?.billingType
1901
1902 // Must be a Claude subscriber with a supported subscription type
1903 if (!isClaudeAISubscriber() || !billingType) {
1904 return false
1905 }
1906
1907 // only allow Stripe and mobile billing types to purchase extra usage
1908 if (
1909 billingType !== 'stripe_subscription' &&
1910 billingType !== 'stripe_subscription_contracted' &&
1911 billingType !== 'apple_subscription' &&
1912 billingType !== 'google_play_subscription'
1913 ) {
1914 return false
1915 }
1916
1917 return true
1918}
1919
1920// Returns whether the user has Opus access at all, regardless of whether they
1921// are a subscriber or PayG.

Callers

nothing calls this directly

Calls 2

getOauthAccountInfoFunction · 0.85
isClaudeAISubscriberFunction · 0.85

Tested by

no test coverage detected