Skip to main content

Share file on Arcana Store

In this tutorial you will learn how to use Arcana Storage SDK and share a file that was earlier uploaded to Arcana Store by the current dApp user with another user.

Prerequisites

  • Make sure your dApp is integrated with Arcana Storage SDK
  • You need to have access to the target user's wallet address for authenticating and enabling file sharing permissions
  • The DID of the file is required in order to share file access and identify it uniquely on the Arcana Store
  • The code in the steps section below refers to StorageProvider and Access objects initialized during Storage SDK integration:
import { StorageProvider } from '@arcana/storage/dist/standalone/storage.umd';

dAppStorageProvider = new StorageProvider({
appId: ARCANA_APP_ID,
provider: window.ethereum,
email: user_email_string,
});

const Access = new dAppStorageProvider.getAccess();

Share file access

// did: DID of file to be shared
// address: recipients address
// validity (optional): For how long will be the user able to download the file, e.g. [400] would mean 400 seconds
Access.share([did], [address]);

What's Next?

You can also change file ownership or revoke file access using Storage SDK.

If you are using Storage SDK with a third party wallet, you can also consider integrating with Arcana Auth SDK to ensure the privacy of your data by encrypting data before uploading and decrypting data after download.

See also