()
| 1896 | * This mirrors the logic in apps/claude-ai `useIsOverageProvisioningAllowed` hook as closely as possible. |
| 1897 | */ |
| 1898 | export 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. |
nothing calls this directly
no test coverage detected