
By Jeffrey Chan
Arweave upload provider for Strapi v5
released June 20, 2025
npm install @longviewlabs/strapi-provider-upload-arweavestrapi::security middlewares to avoid CSP blocked URLsWith npm:
npm install @longviewlabs/strapi-provider-upload-arweave --saveArweave is a decentralized network designed for long-term data storage.
Users pay upfront for uploads based on a calculated storage cost, and Arweave provides guarantees of data replication and storage for a minimum of 200 years. Uploads are immutable and can't be removed.
Data stored on Arweave can be accessed just like any other data using a modern web browser. Take a look at this JSON file stored on Arweave here.
These properties make Arweave an ideal storage option for storing Strapi media files.
Data uploads on Arweave cost AR tokens ($AR). You can get an approximation of your data storage costs using this fee calculator here.
To subsidize and handle data uploads to Arweave, you will need an Arweave wallet. To get started, install Wander β you can download either the browser extension or mobile application, and follow the steps to set up a new wallet.
Once you've set up a wallet, you will need to download a keyfile.
While Wander acts as a GUI to perform data uploads, the keyfile can be used in a more API-like fashion to help facilitate data uploads from within programs such as Strapi.
To download your keyfile:
A modal should appear to download your keyfile, which ends in .json. This should be stored securely.
Here's the content of a JWK file, which describes an RSA-PSS key-pair. Note that the values are abbreviated:
{
"d": "cgeeu66FlfX9wVgZr5AXKlw4MxTlxSuSwMtTR7mqcnoE...",
"dp": "DezP9yvB13s9edjhYz6Dl...",
"dq": "SzAT5DbV7eYOZbBkkh20D...",
"e": "AQAB",
"ext": true,
"kty": "RSA",
"n": "o4FU6y61V1cBLChYgF9O37S4ftUy4newYWLApz4CXlK8...",
"p": "5ht9nFGnpfW76CPW9IEFlw...",
"q": "tedJwzjrsrvk7o1-KELQxw...",
"qi": "zhL9fXSPljaVZ0WYhFGPU..."
}[!WARNING] Anyone with your keyfile can control all of the assets within an Arweave wallet β make sure to keep it secure and private (i.e., do not commit it to GitHub repos or expose it publicly, etc.).
Once you have downloaded your Arweave wallet keyfile, copy its content and set it as the ARWEAVE_WALLET environment variable in your Strapi application. After that, edit the ./config/plugins.js file to configure the upload provider.
module.exports = ({ env }) => ({
// ...
upload: {
config: {
provider: 'arweave',
providerOptions: {
arweaveWallet: env.json('ARWEAVE_WALLET'), // Content of the Arweave wallet JWK
gateway: env('ARWEAVE_GATEWAY', 'https://arweave.net'), // Optional: Arweave Gateway URL, default is 'https://arweave.net'
},
},
},
// ...
});strapi::security middlewares to avoid CSP blocked URLsEdit ./config/middlewares.js:
img-src and media-src, add the Arweave Gateway URL.module.exports = [
'strapi::errors',
{
name: 'strapi::security',
config: {
contentSecurityPolicy: {
useDefaults: true,
directives: {
'connect-src': ["'self'", 'https:'],
'img-src': ["'self'", 'data:', 'blob:', 'arweave.net', '*.arweave.net'],
'media-src': ["'self'", 'data:', 'blob:', 'arweave.net', '*.arweave.net'],
upgradeInsecureRequests: null,
},
},
},
},
'strapi::cors',
'strapi::poweredBy',
'strapi::logger',
'strapi::query',
'strapi::body',
'strapi::favicon',
'strapi::public',
];The following options are available to configure the Arweave upload provider in Strapi:
arweaveWalletThe content of an Arweave wallet JWK (JSON Web Key) file. This is used to sign transactions and upload files to Arweave.
gatewayThe URL of the Arweave gateway to use for accessing files.
This is optional, and if not provided, the default gateway https://arweave.net will be used.
https://arweave.netgetContentTypeA function that is executed to get the content type for a file when it is uploaded.
When no function is provided, the following content type is used:
file.mimeundefinedExample:
getContentType: (file: File) => file.mime;Uploads to Arweave through this Strapi provider are facilitated by ArDrive's Turbo upload service. ArDrive Turbo bundles data uploads together and submits them to Arweave.
ArDrive Turbo uses Turbo Credits to pay for uploads. You can top up your account by logging in to Turbo Topup with your Wander wallet, or use the CLI tool. There are more detailed instructions here.
[!TIP] All uploads under 100KB are subsidised, meaning they are free. However, you will need to top up your account to pay for larger uploads.
See the MIT License file for licensing information.
Share your work with the community and get it listed in the Strapi ecosystem for everyone to discover and use.
Submit
