User Management
The WhopCheckout SDK tracks memberships at both the device level and user level. This allows purchases before login while syncing across devices once users authenticate.
Checking Membership Status
Check Any Subscription
Use isSubscribed to check if the user has access to any of your configured products:
Property Reference: isSubscribed
Returns: true if the user has at least one active membership or StoreKit entitlement.
Check Specific Product
Use hasAccess(to:) when you have multiple products with different access levels:
Method Reference: hasAccess(to:)
Parameters:
productId: The product ID to check (starts withprod_)
Returns: true if the user has an active membership for that specific product.
Accessing Memberships Directly
For more granular control, access the memberships array:
Property Reference: CheckoutMembership
| Property | Type | Description | |----------|------|-------------| | id |
String | Membership ID | | productId | String | Associated product ID |
| status | Status | .active, .cancelled, .expired, etc. | |
isActive | Bool | Whether the membership grants access | | expiresAt |
Date? | When the membership expires | | createdAt | Date | When the
membership was created |
User Login
When a user logs in to your app, call logIn() to associate their account with any device-level purchases:
What Happens on Login
Method Reference: logIn()
Parameters:
appUserId: Your app’s unique identifier for this user. Should not change for the same user.
Note: User IDs should be stable. Don’t use session tokens or values that change on each login.
User Logout
When users log out, call logOut() to clear user-specific data:
After logout, isSubscribed still returns true if there are device-level
memberships that haven’t been claimed by any user. This allows “guest”
purchases to persist.
Method Reference: logOut()
Clears the current user session. Device-level memberships remain accessible.
Guest Purchases
Users can purchase without logging in. The SDK tracks these purchases by device:
How Guest Purchases Work
Device ID
The SDK automatically manages a unique device identifier stored in the iOS Keychain:
Checking Current User
Access the currently logged-in user ID:
FAQ
What if a user purchases on two devices before logging in?
When they log in on either device, both device-level memberships are claimed by their account. The next time they log in on the other device, all memberships sync.
What if the user already has an active subscription when logging in?
When a user logs in with logIn(appUserId:), all device memberships are added to their account. If the user already has existing memberships from another device or account, they keep access to all of them.
Conflict resolution:
- Same product, different plans: The user retains access from both. When one expires, the other continues.
- Same product, same plan: Both memberships remain active. Whop does not cancel duplicates automatically—this is intentional so users don’t lose access they paid for.
If you need to handle duplicate subscriptions, you can check checkout.memberships and guide users to manage their subscriptions via the billing portal.
Can I migrate existing users to WhopCheckout?
Yes. When users log in with logIn(appUserId:), use the same user ID you have
in your existing system. Their memberships (if purchased through Whop) will
sync automatically.
What happens if the user ID changes?
Avoid changing user IDs. If you must, the old user retains their memberships and the new user ID starts fresh.
How do I handle family sharing or multiple accounts per device?
Call logOut() when switching accounts, then logIn(appUserId:) with the new user. Each user’s memberships load independently.

