Rate Limit on Subscriptions (Team Subscription)

  • 22 December 2021
  • 2 replies
  • 44 views

Badge

We are trying to support teams under a single subscription. The logic for checking is if anyone has a subscription then we give everyone in the team access to the premium version of the app.

i.e.

await Promise.all(
[...memberIDs].map(async (memberID) => {
const res = await fetch(`${baseUrl}/${memberID}`, options);
const json = await res.json();
if (Object.keys(json.subscriber?.entitlements).length > 0) {
hasSubscription = true;
}
}),
).catch((e) => {
console.error('RevenueCat error: ', e);
});

But this isn’t working for some users mysteriously. I am wondering if revenuecat has a rate limit around how often a user can ping the server to check subscription status. I don’t see anything about this in the docs. Does anyone know if there is a better way to handle teams or if revenuecat does have a rate limit?


2 replies

Userlevel 4
Badge +10

Hey @Eli 

An error from the API you may run into is duplicated requests for the same subscriber. For example, if 2 people from the same team open the app at the same time and your app is attempting to the GET /subscribers endpoint for all members of a team. 

An alternative solution that some of our customers are utilizing is assigning the RevenueCat app user ID as the ‘teamID’. This would mean the RevenueCat customer page is related to that specific team, so when checking for a subscription status it should be active for all team members under the same app user ID. You’ll have to keep track of team members in your backend if someone is added or removed from the team.  

Badge

Hey @Eli 

An error from the API you may run into is duplicated requests for the same subscriber. For example, if 2 people from the same team open the app at the same time and your app is attempting to the GET /subscribers endpoint for all members of a team. 

An alternative solution that some of our customers are utilizing is assigning the RevenueCat app user ID as the ‘teamID’. This would mean the RevenueCat customer page is related to that specific team, so when checking for a subscription status it should be active for all team members under the same app user ID. You’ll have to keep track of team members in your backend if someone is added or removed from the team.  

It would be pretty cool if we could pass an array of IDs. Not really an option to have a team key for our app as users with a teams subscription are able to make multiple team groups.

Reply