0

I am building a simple static website selling a single pdf file using the Stripe checkout api.

I would like to be able to generate an expiring download link after the customer successfully purchased the pdf.

I am really not sure about how to do this, but I was thinking about using firebase to store the file in a bucket and somehow use a cloud function to generate a temporary download link that expires after some time, but I am not sure how to go about this (or if this is even the best solution).

Can anyone give me some help about which direction to go here?

Boris Grunwald
  • 2,602
  • 3
  • 20
  • 36

1 Answers1

2

Firebase'd download URLs don't expire, although you can revoke the from the Firebase console.

But a better fit for your use-case might be to use Cloud Storage's signed URLs, which have a built-in expiration attribute. You can generate these with the Cloud Storage SDKs or Firebase's Admin SDKs, all of which should only be run in trusted environments - such as your development machine, a server you control, or Cloud Functions.

Also see:

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807