DEV Community

Willy
Willy

Posted on

How do apps manage user credits/ features nowadays?

This seems to be a very common building block for apps, but I can't find popular solutions -

  1. An app has registered users
  2. Every user can have different types of credits, points, enabled-features, used-promo-codes, campaigns etc...
  3. Different parts should behave differently according to those

Sure, we can manage all that data in a DB and write lots of custom code, however it becomes a big block to design, refactor, migrate schema versions, manually resolve issues....

To clarify the question lets simplify to one use-case -
"Credits Management" -

  1. Upon purchase, user gets 1,000 credits of type "paid-credits" to be used in the app. These don't expire.
  2. Upon promo-code-activation, user gets 200 credits of type "promo-credits-feature1" - only to be used with "Feature1" of the app, and those expire after 1 month.
  3. User spends 200 credits on Feature1
  4. User is not satisfied, asks for refund. His "paid-credits" are not used yet, so he qualifies for a no-questions-asked refund.
  5. Upon server-side usage of Feature2, the backend needs to verify the amount of available credits (possibly "reserve X credits" for an activity), log the usage of the credits for traceability (such as an invoice breakdown) etc.

I would expect some existing solution to offer this as a service with an API. Do CRMs have anything to do with these things?

Is it "too simple of a problem" that everybody manage in their DB and don't make a big deal out of it?

It will be nice to hear what others are using and some insights about this.

Top comments (0)