Public
Script
  • stevekrouse avatar
    r2
    @stevekrouse
    r2 wrapper Save blobs without leaving Val Town! Only for Val Town Pro users to limit abuse. We get 10gb free, so as long as nobody abuses this, I won't put any strict limits on it. If you want to use more than 10gb, let me know, and we can bill you for it. All data in this bucket is public if you know it's name! This val, @stevekrouse.r2, is the "SDK" for @stevekrouse.r2Proxy . Setup This val requires you to setup public key auth, which is really just three clicks here: https://blog.val.town/public-key-auth-val-town-users-can-be-your-users [Optional] You can setup a helper function so you don't have to pass your keys every time: let blob = (key, value) => @stevekrouse.r2(key, value, @me.exportedKeys) Warning: Do not make your blob function public or unlisted. That would allow anyone to use it. Usage await @me.blob("demo", { hello: "world" }); return @me.blob("demo"); // {hello: "world"} Example usage: https://www.val.town/v/stevekrouse.r2Demo
    Script
1
Next
October 23, 2023