5. Add Storage

Interact with storage spaces in your app

Spaces key-value data stores that are generally used to keep application-specific or context-specific data in a sandboxed location controlled by the user. Spaces can support keeping public or encrypted information. When saving data to a space, use a key to set a value.

This section describes how to perform various interactive functionalities on a 3Box space store, including adding/removing data, and decrypting private data. To perform these actions, you must first authenticate the space.

If you only need to display public space data for a user or multiple users in your application, you can use the static read-only get methods described here.

Use Cases

  • App-specific user settings, defaults, preferences

  • Decentralized localStorage

  • User-generated content for your app

  • Threads for your app

  • App-specific profile information

3Box's API is not suitable for file storage. If you wish to store files, we recommend to store the files directly on IPFS. The IPFS hash can be stored on 3Box, providing a link to the user's 3Box account. 3Box Hub uses this approach to store images.

Read Infura's uploading files to IPFS documentation.

Jump to...