#Emanuel-firebase

1 messages ยท Page 1 of 1 (latest)

spiral creek
#

hi, unfortunately I have no idea, I haven't used Firebase or those extensions we have myself and know nothing about how to work with its collections.

fickle harness
#

Hey, stepping in here as I have a bit of context around Firebase and our extensions

nimble briar
fickle harness
#

No, but you could build an API to wrap that call that your client can talk to

#

You'll struggle to do this without the admin SDK, tbh

nimble briar
#

Let me give it some more thought ๐Ÿ™‚

#

Thanks for the input, probably need something like this

#

But, in theory, I could update the user-collection with the subscription state and let the clients read that state

#

just need to know when to update - either by trigger (fb function) or something else

fickle harness
#

You could, but then that's overhead for you to maintain

#

I'd probably do it via Stripe events

#

And have a webhook that updates the Firestore document

nimble briar
#

the extensions already have some of these setup - can I somehow re-use them, or do I need to create new ones from scratch?

fickle harness
#

Well you'd need to write your own function as a webhook endpoint for your Stripe events

#

You could open a PR on the extension (I maintain it) but I'm not sure it's something we'd merge

nimble briar
#

What would be brilliant is for the extension to also update named field in the user collection with the meta data as it does for the claim

fickle harness
#

Feel free to open an issue or even better a PR

nimble briar
#

ill have a look

#

๐Ÿ™‚

#

thanks

fickle harness
#

np!

spiral creek
#

Emanuel-firebase

nimble briar
#

I am not sure how to actually test my code locally in this case

#

admin .firestore() .doc(customersSnap.docs[0].ref) .update({stripeRole: role})

#

also, this might not apply for everyone so I guess it should/could be optional

fickle harness
#

I'll take a look at the issue when I have some time