Hey I hope this wasn't answered before
Hey I hope this wasn't answered before but wasn't able to find the answer i was looking for.
I have a monetary credit system.
eg. User on Starter Plan receives 100 credits for 99€/month.
User on Team Plan receives 500 credits for 249€/month.
I have multiple features like roof_visualization, vision+, etc which is a single use feature.
The credit system lets me assign different values for each feature.
Some of the features i wanna gate to different plans, so starter should only have access to roof_visualization, Team plan also e.g. should have allowance for vision+ included.
When i want to trigger a visualization from the webapp I get an error during the check ().
I assume this is because the feature is not assigned to that plan.
Now when I try to assign the feature to any plan through the dashboard I get:
"Included usage for feature roof_visualization must be greater than 0"
(Because i already give x amount of credits for the plan, i don't wanna add additional feature specific ones from the feature itself)
Would the solution be to create a boolean feature (roof_viz_allowed) for feature gating per plan, and keep the metered feature (roof_visualization) for credit tracking via the credit_schema?
So when checking for allowed, I do not check the actual metered feature being assigned to the plan but for the boolean? So they basically co-exist?
roof_visualization for metering // roof_viz_allowed as boolean for allow check?
Using Nextjs // BetterAuth // Convex - AutumnComponent
Thanks in advance!
I have a monetary credit system.
eg. User on Starter Plan receives 100 credits for 99€/month.
User on Team Plan receives 500 credits for 249€/month.
I have multiple features like roof_visualization, vision+, etc which is a single use feature.
The credit system lets me assign different values for each feature.
Some of the features i wanna gate to different plans, so starter should only have access to roof_visualization, Team plan also e.g. should have allowance for vision+ included.
When i want to trigger a visualization from the webapp I get an error during the check ().
I assume this is because the feature is not assigned to that plan.
Now when I try to assign the feature to any plan through the dashboard I get:
"Included usage for feature roof_visualization must be greater than 0"
(Because i already give x amount of credits for the plan, i don't wanna add additional feature specific ones from the feature itself)
Would the solution be to create a boolean feature (roof_viz_allowed) for feature gating per plan, and keep the metered feature (roof_visualization) for credit tracking via the credit_schema?
So when checking for allowed, I do not check the actual metered feature being assigned to the plan but for the boolean? So they basically co-exist?
roof_visualization for metering // roof_viz_allowed as boolean for allow check?
Using Nextjs // BetterAuth // Convex - AutumnComponent
Thanks in advance!


