Using putFile without logging in?

Is it possible to use putFile without logging in? I’m looking for a way for visitors to be able to write data. I was able to get putFile working when logged in but when I logged out it stopped working and I get the error: “InvalidStateError: Missing userData”.

Any help appreciated!

Where should they write to? What address? You can write to gaia if you provide a private key but blockstack.js does not support that directly.

I was hoping apps would have their own buckets to store data just like users do.

Looks like I’ll need to enlist a third party to cover this void for now.

You can generate an address and use that for the app bucket. However, each visitor of your app will write to the same storage and know the private key (if they look into the code).

Example code can be found here: https://github.com/openintents/calendar-web/blob/master/src/core/event.js#L42

@paid You can use uploadToGaiaHub then https://github.com/blockstack/blockstack.js/blob/master/src/storage/hub.ts#L35

Thank you!