Skip to main content
Question

Connecting existing Stripe subscriptions to Firebase UID


Forum|alt.badge.img

Hello!

 

I have a setup of Stripe => Webhook RevenueCat => Firebase integration.

In some cases Stripe subscription is created out of the scope of RevenueCat integrations resulting in customers with an anonymous app_user_id which need to be connected to the Firebase UID manually.

 

  1. Adding firebaseUID manually to Stripe’s customer and subscription metadata does not update RevenueCat app_user_id even tho subscription update event is successfully delivered to RevenueCat
  2. Posting the receit via RevenueCat API does indeed add a correct alias to the customer, however that is not reflected in the Firestore database via the Firebase integration. Furthermore, I would need to get the firebaseUID as the main app_user_id, not an alias to be able to access it in Firestore.

 

Please help me out, how should I go about this?

This post has been closed for comments

2 replies

hussain
RevenueCat Staff
Forum|alt.badge.img+2
  • RevenueCat Staff
  • 24 replies
  • April 28, 2025

Hey there,

If a Stripe subscription is created directly (without going through RevenueCat first), RevenueCat doesn't automatically link this subscription to your intended Firebase UID—even if you manually add the Firebase UID in Stripe metadata. RevenueCat identifies users primarily via the app_user_id you explicitly set through the SDK, rather than Stripe metadata.

A solution to your problem could look like:

  • Use Firebase Authentication to get the Firebase UID.

  • Call logIn(firebase_uid) using the RevenueCat SDK at authentication to set the correct custom user id.

  • Then post Stripe receipts via RevenueCat’s API to that primary Firebase UID (like you are doing and include the same app_user_id in that.)

Hope this helps.

Best,

Hussain


Forum|alt.badge.img
  • Author
  • New Member
  • 1 reply
  • April 29, 2025

Thank you, Hussain, will try it out!


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