revenuecat-identify-user
Tie RevenueCat identity to your app's auth system. Use when the user asks to log in to RevenueCat, sync a user with RevenueCat, switch RevenueCat user on login, log out of RevenueCat, move a user from anonymous to identified, set appUserID, or handle account switching on iOS, Android, Kotlin Multiplatform, Flutter, or React Native.
How do I install this agent skill?
npx skills add https://github.com/revenuecat/ai-toolkit --skill revenuecat-identify-userIs this agent skill safe to install?
- Gen Agent Trust Hubpass
This skill provides implementation guides and code snippets for integrating RevenueCat's identity management system across various mobile platforms. It follows security best practices by recommending opaque identifiers over personally identifiable information (PII) and uses official RevenueCat SDKs.
- Socketpass
No alerts
- Snykpass
Risk: LOW · No issues
What does this agent skill do?
revenuecat-identify-user: connect RevenueCat to your auth system
Use this skill when the user wants to call logIn / logOut on the RevenueCat SDK so that their app users line up with RevenueCat subscribers. This skill does not cover initial SDK setup (see integrate-revenuecat), purchases (revenuecat-purchase-flow), or gating (revenuecat-entitlements-gate).
1. Detect the platform
Inspect the working directory and pick the first match, from top to bottom:
- React Native:
package.jsonhas areact-native-purchasesentry, orreact-nativeas a dependency → readplatforms/react-native.md. Ifexpois also a dependency, note it as an Expo project. - Flutter:
pubspec.yamlexists at the project root → readplatforms/flutter.md. - Kotlin Multiplatform:
build.gradle.ktscontains akotlin { … }multiplatform source sets block, or depends oncom.revenuecat.purchases:purchases-kmp*→ readplatforms/kmp.md. - Android (native):
build.gradle(.kts)appliescom.android.application(and is not KMP) → readplatforms/android.md. - iOS (native):
Package.swift,*.xcodeproj,*.xcworkspace, orPodfileat the project root → readplatforms/ios.md.
If several match (e.g. an ios/ folder inside a Flutter project), pick the outermost project, the one that owns the build. If still ambiguous, ask the user which platform they want to configure.
2. Shared concepts (all platforms)
- Anonymous by default. Before
logInis called, RevenueCat assigns a stable anonymous ID prefixed$RCAnonymousID:. Purchases made while anonymous are aliased onto the realappUserIDthe first timelogInis called with it, so there is no "lost purchase" risk from letting users buy before signing in. - Never use email, phone number, or a sequential database id as the appUserID. Use a stable opaque value such as your backend's user UUID, or a hash of the user id. RevenueCat treats the ID as an opaque string and it is difficult to change later.
- Call
logInafter your auth system confirms the session. Do not calllogInspeculatively. The typical trigger is your auth state listener firing with a signed in user.logInreturns both the user's currentCustomerInfoand acreated: Booleanthat tells you whether this is a brand new RevenueCat customer. logOutonly works on identified users. CallinglogOutwhile the SDK is on an anonymous ID throws an error in every SDK (PurchasesErrorCode.LogOutWithAnonymousUserErroror the iOS equivalent). Gate it behind your own "is signed in" flag.- Restore is not login.
restorePurchases()asks the store for the current receipt and attaches it to the current RevenueCat user. It does not switch identities. If the user signs in on a new device, calllogIn(appUserID)first, thenrestorePurchases()only if they also expect to pull a receipt from the current store account. - Account switching is
logOutthenlogIn. If your app lets a user sign out and sign back in as someone else, calllogOut()first, wait for it, thenlogIn(newId). Do not try to swap directly with a secondlogIn, since that will alias the two IDs together. - Configure first.
Purchases.configure(…)must have run beforelogIn/logOut. If it has not, the SDK throws.
3. Implementation
Read the platform file that matches detection:
platforms/ios.mdplatforms/android.mdplatforms/kmp.mdplatforms/flutter.mdplatforms/react-native.md
Each platform file shows the logIn and logOut calls wired into a typical auth state observer.
4. Verify
Do not claim identity sync works until:
- In the RevenueCat dashboard, the Customer page for your test user shows the same appUserID your backend uses, not the
$RCAnonymousID:placeholder. - Signing out clears the ID back to a fresh anonymous user; signing in as a different account switches to that account's purchases (or shows none if it is a new account).
- A purchase made while anonymous, followed by
logIn, remains attached to the signed in user (aliased, not lost). - Calling
logOutwhile already anonymous is handled, not treated as a crash or a silent success.
How can the creator link this skill?
Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.
<a href="https://skillzs.dev/skills/revenuecat/ai-toolkit/revenuecat-identify-user">View revenuecat-identify-user on skillZs</a>