Question

How to retrieve RevenueCat subscription details on my website

  • 10 June 2022
  • 1 reply
  • 15 views

Badge

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?)

1 reply

Userlevel 1
Badge +3

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.

Reply