Skip to main content
Question

How to retrieve RevenueCat subscription details on my website

  • June 10, 2022
  • 1 reply
  • 117 views

Forum|alt.badge.img+1

I have a multi-platform SaaS (Software as a Service) for iOS, Android, and web.

 

Purchase Services

Web: Stripe
iOS: Appstore IAP
Android: Google Play IAP

All purchases are connected to RevenueCat.

As far as I can tell, there is no library for web developers to access information, only a REST API.

 

How are websites checking if a user is a entitled/paying member?

 

My current plan for implementation is as follows:

  1. Get Subscriber via Rest AI
  2. Check the resulting object’s `subscriber.entitlements[‘my-entitlement-id’]`
    1. paying/subscribed if exists & if `expires_date` > `current_date` 

 

Question 1: Is this the best method to achieve this OR is there a web SDK somewhere?

Question 2: How often should I poll for subscription information?

  1. Should I hit the database every time they navigate to a new membership page?
  2. Should I cache the membership information for a specific amount of time (somehow?)
This post has been closed for comments

Miguel Carranza
RevenueCat Staff
Forum|alt.badge.img+6

Hi @wcooperscott,

 

We are currently working on a revision of our API to make it way more developer friendly for use cases like this. But for now, that’s the only way to get subscriber info. 

 

However I would suggest leveraging RevenueCat’s webhooks to keep your server synced instead. With this approach, the amount of polling should be close to none.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings