Respect DEFAULT_BILLING_MODE env var for self-hosters#194
Draft
cfurrow wants to merge 13 commits intoSnouzy:mainfrom
Draft
Respect DEFAULT_BILLING_MODE env var for self-hosters#194cfurrow wants to merge 13 commits intoSnouzy:mainfrom
cfurrow wants to merge 13 commits intoSnouzy:mainfrom
Conversation
|
@cfurrow is attempting to deploy a commit to the Workoutcool Team Team on Vercel. A member of the Team first needs to authorize it. |
it reads in the env variable details about the current billing mode
…lling mode (disabled, freemium, etc)
…s disabled, or freemium
9ad6590 to
fea6dec
Compare
cfurrow
commented
Nov 11, 2025
Comment on lines
+38
to
+41
| // Don't show ads if billing is disabled (self-hosted instances with no billing) | ||
| if (billingMode === "DISABLED") { | ||
| return <>{fallback}</>; | ||
| } |
Author
There was a problem hiding this comment.
Should "FREEMIUM" still show ads? It would in this case, and only disable ads if user is premium, or if the billing mode was "DISABLED"
cfurrow
commented
Nov 11, 2025
Comment on lines
+36
to
+38
| DEFAULT_BILLING_MODE: z | ||
| .enum(["DISABLED", "LICENSE_KEY", "SUBSCRIPTION", "FREEMIUM"]) | ||
| .default("DISABLED"), |
Author
There was a problem hiding this comment.
This could be a breaking change if DEFAULT_BILLING_MODE is not currently set in environments, we would be defaulting to "disabled" which may not be expected. I'll note this in the PR description.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Description
As pointed out in issue #177, the
DEFAULT_BILLING_MODEenv variable does not appear to be respected or used, and the premium "gates" and ads still show when self hosting and setting that variable to "DISABLED" or "FREEMIUM".Looking at the code, it appears that using this env var was not implemented yet.
This PR creates a centralized place to retrieve the billing configuration details, and also hides any premium gates or ads if the billing config is disabled or set to "freemium".
NOTE: I used Claude Code to help me find all places that needed new billing config logic introduced that would support the "disabled" or "freemium" values of DEFAULT_BILLING_MODE.
📋 Checklist
🗃️ Prisma Migrations (if applicable)
📸 Screenshots (if applicable)
Premium status is "active" when setting
DEFAULT_BILLING_MODE="DISABLED"Statistics page does not render the "upgrade" overlay when

DEFAULT_BILLING_MODE="DISABLED"The "remove ads" link is removed when

DEFAULT_BILLING_MODE="DISABLED"I created a "premium" program, and all users can see/use it when
DEFAULT_BILLING_MODE="DISABLED"And more, I'm sure.
🔗 Related Issues
#177