Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.prudra.dev/llms.txt

Use this file to discover all available pages before exploring further.

Files overview

Vaults can store binary files alongside JSON documents. Files are uploaded to Google Cloud Storage and served from the Prudra CDN at assets.prudra.dev. File URLs are stable for the lifetime of the vault.

How file storage works

Your server uploads the file buffer. Prudra generates a GCS presigned URL, uploads the file, and returns a CDN URL you can share with the caller.

Quick example

import multer from 'multer';

const upload = multer({ storage: multer.memoryStorage() });

app.post(
  '/analyse-csv',
  walletMiddleware({ walletId: 'byw_clx1abc123' }),
  payMiddleware({ price: '0.05', description: 'CSV analysis' }),
  vaultMiddleware(),
  upload.single('file'),
  async (req, res) => {
    const vault = req.vault!;

    // Upload original file to vault
    const file = await vault.addFile(
      req.file!.buffer,
      req.file!.originalname,
      req.file!.mimetype,
    );

    // Store analysis result
    await vault.addDocument({ rowCount: 100 }, 'Analysis');
    await vault.seal('Analysis complete');

    res.json({
      vaultId:  vault.id,
      fileUrl:  file.url,           // CDN URL: https://assets.prudra.dev/...
      fileName: file.name,
    });
  }
);

Plan file limits

LimitHobbyProEnterprise
Files per vault5100Unlimited
Max file size10 MB100 MB1 GB
Total storage500 MB10 GBUnlimited

Sub-pages

Upload files

Upload files to a vault and get CDN URLs.

Download files

Download file contents from the CDN.

Delete files

Remove individual files from a vault.