stack/packages/template/src
Armaan Jain d78405d7e7
Gate usage limit banners behind HEXCLAVE_DISABLE_PLAN_LIMITS (#1728)
## Summary

Threads `arePlanLimitsEnforced()` from the backend through the
plan-usage API response so the dashboard can hide all usage limit
banners when `HEXCLAVE_DISABLE_PLAN_LIMITS=true`.

Backend adds `are_plan_limits_enforced` to `planUsageResponseSchema`
(`.optional().default(true)` for backward compat with older backends) →
SDK surfaces it as `PlanUsage.arePlanLimitsEnforced` with `?? true`
runtime fallback (since `getPlanUsage()` returns raw JSON without yup
validation) → banner components early-return `null` when
`!arePlanLimitsEnforced`.

For the projects page (outside admin-app context, no project selected),
a server action reads the env var directly via
`getEnvVariable(\"STACK_DISABLE_PLAN_LIMITS\", \"false\")`.

Link to Devin session:
https://app.devin.ai/sessions/09ca53f13c294c8e98c7a7227a52217d
Requested by: @Developing-Gamer

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Added support for a “plan limits enforced” flag to control messaging
across usage and billing-related screens.
* Projects and team invitation capacity checks now respect the same
enforcement toggle (including admin-seat invitation blocking).

* **Bug Fixes**
* Limit banners and “plan limit exceeded” alerts now only render when
enforcement is enabled (and overage/threshold conditions are met).
* Updated usage payload handling to default to enforcement enabled when
the flag is missing; added/updated tests for both enabled and disabled
scenarios.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: armaan <armaan@stack-auth.com>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-07-05 21:17:21 -07:00
..
clickmap feat(analytics): add route analytics heatmaps (#1520) 2026-06-15 12:06:16 -07:00
components fix: suppress React 19 script warning in SsrScript (#1648) 2026-06-23 12:16:14 -07:00
components-page fix: prevent OAuth callback race condition between startup handler and OAuthCallback component (#1671) 2026-06-26 11:44:28 -07:00
dev-tool Fix redirect URL on devtool indicator 2026-06-26 14:12:47 -07:00
generated Fix Vite environment variables 2026-06-05 16:42:11 -07:00
in-page-ui feat(analytics): add route analytics heatmaps (#1520) 2026-06-15 12:06:16 -07:00
integrations Document init script less 2026-06-26 13:50:48 -07:00
lib Gate usage limit banners behind HEXCLAVE_DISABLE_PLAN_LIMITS (#1728) 2026-07-05 21:17:21 -07:00
providers feat(hexclave): PR 5 — internal symbol/path/package renames + brand strings (#1547) 2026-06-03 18:57:09 -07:00
pushed-config-error-overlay Fix overlay warning 2026-06-24 11:25:58 -07:00
utils feat(hexclave): PR 3 — native @hexclave/* source rename + delete dual-publish wiring (#1482) 2026-05-29 15:21:59 -07:00
config.ts fix(rde): graceful config load errors + lightweight /config import path (#1557) 2026-06-10 11:40:19 -07:00
global.css Vanilla JS client library (#408) 2025-02-08 02:31:03 +01:00
global.d.ts Fix Vite environment variables 2026-06-05 16:42:11 -07:00
index.ts feat(hexclave): PR 5 — internal symbol/path/package renames + brand strings (#1547) 2026-06-03 18:57:09 -07:00
tanstack-start-server-context.combined.ts [codex] Add TanStack Start SDK integration (#1399) 2026-05-08 10:59:16 -07:00
tanstack-start-server-context.d.ts feat(hexclave): PR 3 — native @hexclave/* source rename + delete dual-publish wiring (#1482) 2026-05-29 15:21:59 -07:00
tanstack-start-server-context.default.ts [codex] Add TanStack Start SDK integration (#1399) 2026-05-08 10:59:16 -07:00
tanstack-start-server-context.server.ts [codex] Add TanStack Start SDK integration (#1399) 2026-05-08 10:59:16 -07:00