Customers

Understand how customers connect your app users to purchases, subscriptions, trials, add-ons, and entitlements.

A customer represents an end user of your app.

Revenipe uses the customer ID to attach purchases, subscriptions, trials, add-ons, entitlements, and usage state to the correct user.

How customers work

Customers are the connection between your app and Revenipe access state.

When your app logs in a customer through the SDK, Revenipe loads the current access state for that customer.

  • active subscriptions

  • completed one-time purchases

  • active trials

  • granted entitlements

  • remaining limited values

  • usage state

Customer IDs

A customer ID is the stable identifier your app uses for an end user.

For registered users, this ID should come from your own authentication system, database, or backend.

user_123
firebase_uid_abc
supabase_user_id
internal_customer_id

Login a customer

Login a customer before fetching products, starting purchases, checking entitlements, or tracking usage.

Example
await Revenipe.instance.login('customer_123');

Use the same customer ID across app sessions. If the customer ID changes, Revenipe will treat the user as a different customer.

Anonymous customers

Use anonymous login when the user does not have an account yet.

Anonymous login is useful for guest users, onboarding flows, or apps that allow users to start without registration.

Example
await Revenipe.instance.anonymLogin();

For registered users, use your own stable customer ID. For guest users, use anonymous login instead of creating random customer IDs yourself.

Customers and purchases

When a customer starts a purchase, the purchase is attached to that customer ID.

This allows Revenipe to update the correct customer access state after the payment, trial, add-on, or provider-side purchase is confirmed.

  • subscriptions belong to a customer

  • one-time purchases belong to a customer

  • add-ons belong to a customer

  • entitlements are granted to a customer

  • usage is tracked for a customer

Refresh customer state

After a purchase, trial, checkout flow, Payment Sheet flow, add-on purchase, or provider-side purchase is completed, refresh the customer state.

Example
await Revenipe.instance.refreshEntitlements();

After refreshing, your app can check entitlements or usage values from the latest customer state.

Example
final hasPremium = Revenipe.instance.hasEntitlement('premium_access'); final credits = Revenipe.instance.getEntitlement('credits');

Important

Do not create a new customer ID every time the app starts.

If the customer ID changes, Revenipe will treat it as a different customer and the app may not see the expected purchases, subscriptions, entitlements, or usage state.

For registered users, always use a stable ID from your own authentication system.

For guest users, use anonymous login.

Next steps

After understanding customers, continue with products, entitlements, and purchase flows to understand how customers receive access.