Vana SDK - v3.13.3
    Preparing search index...

    Class VanaStorage

    Storage provider that talks to the vana-storage Worker (https://storage.vana.org by default). All requests are authenticated with Web3Signed headers signed by the configured wallet.

    Filenames passed to VanaStorage.upload must be of the form "{scope}/{collectedAt}" (e.g. "instagram.profile/2026-05-08T20:00:00.000Z"). The owner address is prepended automatically to produce the canonical blob path /v1/blobs/{owner}/{scope}/{collectedAt}.

    When VanaStorageConfig.network or VanaStorageConfig.chainId is set, paths are chain-scoped as /v1/chains/{chainId}/blobs/{owner}/{scope}/{collectedAt} so different chains never collide on the same host. The Web3Signed audience remains the endpoint origin regardless of network.

    import { privateKeyToAccount } from "viem/accounts";
    import { VanaStorage } from "@opendatalabs/vana-sdk/node";

    const account = privateKeyToAccount(process.env.PRIVATE_KEY as `0x${string}`);
    const storage = new VanaStorage({
    signer: {
    address: account.address,
    signMessage: (msg) => account.signMessage({ message: msg }),
    },
    });

    const result = await storage.upload(
    new Blob([ciphertext]),
    "instagram.profile/2026-05-08T20:00:00.000Z",
    );

    Implements

    Index

    Methods

    • Upload an encrypted blob to vana-storage.

      Parameters

      • file: Blob

        The blob to upload.

      • Optionalfilename: string

        Required relative key in the form "{scope}/{collectedAt}". The owner address is prepended automatically.

      Returns Promise<StorageUploadResult>

    • Listing is not supported by vana-storage — file discovery is handled by the Gateway DataRegistry, not the storage layer.

      Parameters

      • Optional_options: StorageListOptions

      Returns Promise<StorageFile[]>