Skip to content

Add client-side usage rate limiting with OPFS persistence#1472

Open
rpstohr-prim wants to merge 2 commits intobldrs-ai:mainfrom
rpstohr-prim:feature/usage-rate-limiting
Open

Add client-side usage rate limiting with OPFS persistence#1472
rpstohr-prim wants to merge 2 commits intobldrs-ai:mainfrom
rpstohr-prim:feature/usage-rate-limiting

Conversation

@rpstohr-prim
Copy link
Copy Markdown
Contributor

Summary

  • Adds client-side model load rate limiting for PLG conversion (daily + monthly limits by user tier)
  • Persists usage data across three storage layers: OPFS (highest priority), localStorage, and cookies
  • OPFS layer survives casual "Clear browsing data" actions, restoring counts to localStorage/cookie on reload

Test plan

  • Load a model as anonymous user — verify daily/monthly counters increment
  • Exceed daily limit — verify UsageLimitDialog appears
  • Clear localStorage + cookies → reload — verify counts restored from OPFS
  • DevTools > Application > Storage > OPFS — verify .bldrs/usage.json exists after model load
  • Firefox private browsing (OPFS blocked) — verify app works with localStorage/cookie fallback only

🤖 Generated with Claude Code

rpstohr-prim and others added 2 commits March 2, 2026 09:40
Enforce daily/monthly model load quotas (anonymous: 1/5, free: 5/25, pro: unlimited) via localStorage + cookie backup. Shows auth-aware gate dialog prompting sign-in or upgrade when limits are reached. Sample models and built-in project files are always exempt.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds Origin Private File System (OPFS) as the highest-priority persistence
layer for usage tracking data, making it resilient to casual "Clear browsing
data" actions that wipe localStorage and cookies.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@netlify
Copy link
Copy Markdown

netlify bot commented Mar 2, 2026

‼️ Deploy request for bldrs-share-dev rejected.

Name Link
🔨 Latest commit 6d7ebdf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant