javascript - How to enable and use file versioning in Firebase Storage? -


firebase storage based on google cloud platform allows versioning of files.

in firebase console there no options regarding gcp bucket, , when accessing gcp console, there doesn't seem way on enabling versioning in bucket pertaining firebase project.

also, firebase sdk not mention how access previous versions of files if versioning enabled.

is versioning possible firebase storage?

firebase storage built on gcs many of features of gcs can accessed via firebase storage. firebase storage shares gcs bucket named <project-id>.appspot.com (or similar), can accessed via both firebase console , cloud console.

you can enable object versioning on bucket using gsutil tool (probably easiest way) so:

gsutil versioning set on gs://<project-id>.appspot.com 

that said, there's no way of using firebase storage clients retrieve other recent version. intentional, since firebase storage provides simpler, mobile focused subset of gcs apis, , didn't have super compelling use case providing intuitive object versioning story mobile. per user data backups (initiated user without dev intervention), , document diffs 2 can think of, if you've got another, we'd love hear :)

we anticipate majority of devs turn on in order prevent deletions being permanent (and indeed, mention doing in our delete docs), , use tools gsutil or own custom backends retrieve , restore appropriate files.

edit 10/1: since these use cases have become more common, we've updated our docs include more things can google cloud platform in our gcp integration guide.