Login customers

Login registered or anonymous customers so Revenipe can attach purchases, subscriptions, trials, add-ons, and entitlements to the correct user.

Before your app can fetch customer-specific products, start purchases, check entitlements, or track usage, the customer must be logged in through the Revenipe SDK.

Revenipe supports both registered customer login and anonymous login.

Login types

Revenipe supports two customer login flows.

Login type

Use case

Registered customer login

Use this when your app already has a stable user ID from your own authentication system.

Anonymous login

Use this when the user does not have an account yet or you want to allow guest usage.

Registered customer login

Use registered customer login when you already know the user.

The customer ID should come from your own authentication system, user database, or backend.

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

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

Anonymous login

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

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

Example
await Revenipe.instance.anonymLogin();

After anonymous login, the SDK can fetch products, start purchase flows, check entitlements, and track usage for the anonymous customer.

Choosing a customer ID

Good

Avoid

Your internal user ID

Random ID on every app start

Firebase Auth UID

Temporary session ID for registered users

Supabase user ID

Email address if it may change

Backend user ID

Device-only ID for registered users

Important

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

For guest users, use anonymous login instead of creating random customer IDs yourself.

Next steps

After logging in a customer, fetch products, start purchase flows, check entitlements, or track usage.