I’m building an AI image generation app with a credit-based billing system.
Users purchase credits via Google Play / Apple billing (handled through RevenueCat). Each image generation consumes credits from the user’s balance.
Free users too get few initial credits to try out.
Currently:
-
I use anonymous authentication (no email/password or social login).
-
Credits are tied to the user’s ID (supabase anonymous auth).
-
If the user reinstalls the app, they lose their unique ID and therefore lose access to their remaining credits.
My concern is how to properly manage and persist credits in this setup.
What is the recommended approach for:
-
Preventing credit loss after reinstall?
-
Maintaining credit balance securely when using anonymous authentication?
-
Handling this cleanly with Google Play/Apple + RevenueCat?
I want to avoid account linking (email/Google sign-in).
Looking for best practices in production apps.