Skip to content

fix(billing): increase free tier credits#862

Merged
Sg312 merged 2 commits intostagingfrom
improvement/free-tier-pricing
Aug 4, 2025
Merged

fix(billing): increase free tier credits#862
Sg312 merged 2 commits intostagingfrom
improvement/free-tier-pricing

Conversation

@Sg312
Copy link
Contributor

@Sg312 Sg312 commented Aug 4, 2025

Summary

Increases free tier credits to 10 from 5

Type of Change

  • Other: Updates free tier pricing

Testing

Tests

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Aug 4, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sim ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 4, 2025 7:26pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
docs ⬜️ Skipped (Inspect) Aug 4, 2025 7:26pm

@vercel vercel bot temporarily deployed to Preview – docs August 4, 2025 19:20 Inactive
@Sg312 Sg312 changed the title Update free tier to 10 improvement(billing): increase free tier pricing Aug 4, 2025
@Sg312 Sg312 changed the title improvement(billing): increase free tier pricing improvement(billing): increase free tier credits Aug 4, 2025
@Sg312 Sg312 marked this pull request as ready for review August 4, 2025 19:22
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Summary

This PR increases the free tier credits from $5 to $10 across the Sim application by introducing a centralized constant DEFAULT_FREE_CREDITS and systematically replacing hardcoded values throughout the billing system.

The change introduces a new constant DEFAULT_FREE_CREDITS = 10 in apps/sim/lib/billing/constants.ts and updates 12 files across the billing infrastructure. The affected areas include:

  • Core billing logic: Subscription state management, usage monitoring, and billing calculations
  • Database schema: Default currentUsageLimit for new users in the userStats table
  • Frontend components: Subscription settings modal fallback values
  • Authentication: User initialization with proper credit limits
  • Organization billing: Team member usage limits and plan configurations
  • Test suites: Updated test data and assertions to reflect the new credit amount

This change follows the codebase's modular architecture by centralizing billing constants, making the configuration more maintainable and reducing the risk of inconsistencies. The systematic approach ensures that all parts of the billing system—from user registration to usage monitoring to subscription management—consistently apply the new $10 free tier limit.

The implementation properly handles fallback scenarios where environment variables (FREE_TIER_COST_LIMIT) might not be set, ensuring the new default takes effect across development and production environments.

Confidence score: 4/5

  • This PR is safe to merge with minimal risk as it's a straightforward configuration change that increases user benefits
  • Score reflects the systematic approach and thorough coverage, with a minor deduction for one inconsistent hardcoded value
  • Pay close attention to apps/sim/lib/billing/core/usage.ts line 321 which still contains a hardcoded fallback value of 5 instead of using the new constant

13 files reviewed, no comments

Edit Code Review Bot Settings | Greptile

@Sg312 Sg312 changed the title improvement(billing): increase free tier credits fix(billing): increase free tier credits Aug 4, 2025
@Sg312 Sg312 requested a review from waleedlatif1 August 4, 2025 19:28
Copy link
Collaborator

@waleedlatif1 waleedlatif1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Sg312 lgtm, let's make sure to also update the envvar for FREE_TIER_COST_LIMIT to 10

@Sg312 Sg312 merged commit e71a736 into staging Aug 4, 2025
5 checks passed
waleedlatif1 pushed a commit that referenced this pull request Aug 5, 2025
@waleedlatif1 waleedlatif1 deleted the improvement/free-tier-pricing branch August 6, 2025 02:01
waleedlatif1 pushed a commit that referenced this pull request Aug 6, 2025
arenadeveloper02 pushed a commit to arenadeveloper02/p2-sim that referenced this pull request Sep 19, 2025
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.

2 participants