Question

Team Accounts Associated with an Enterprise Accounts Subscription using Aliases? How to Delete an Alias?

  • 8 January 2024
  • 1 reply
  • 32 views

Badge +2

I have setup a enterprise and team account system in my flutter ios and android app. I have used AWS Cognito for the user accounts and i am linking the enterprise accounts user_id to their purchased subscription in revenue cat. Now when an enterprise user creates a team account i have it so that a lambda function uses the rest api from revenue cat to add the team accounts user id as an alias of the enterprise accounts subscription. This all works correctly and gives the team account the same subscription as the enterprise account. 

Now here is where the problem comes in. If an enterprise user deletes a team account I can’t find a way to also delete that alias for the team account that I created from the lambda function that calls revenue cats rest api. Since there is a limit of 50 aliases on a subscription this means if the enterprise user created 50 team accounts and deleted all of them these aliases would still exist and they can’t link anymore accounts to there subscription anymore. This is why I need to remove an alias each time the team account is deleted. 

What are my options, does anyone know how can I fix this problem?


1 reply

Badge +2

Actually, I have come up with a solution. Instead of creating the alias as the team accounts userId when a team account is created i instead just create the alias as the enterprise accounts user Id and then i attached #team to it so EnterpriseUserID#Team. All my team accounts have a field in cognito called subscriptionId that is EnterpriseUserID#Team. So now all team accounts can share the same alias. So now in my flutter app for team accounts i verify their subscription using the subscriptionId which is the EnterpriseUserID#Team and it correctly matches the enterprises accounts subscription. Not sure if this is how I should be doing it but it works great. I know this means I can’t track each team account login since they are sharing an alias but I don’t really need that.

Reply