The user's session keypair for authentication
The storage key (without welshare:// prefix). Use
resolveStorageKey() to convert from URL format.
The Welshare API environment configuration
Promise containing presignedUrl (S3 GET URL)
import { WelshareApi, resolveEnvironment } from "@welshare/sdk";
const storageKey = WelshareApi.resolveStorageKey(binaryFile.url);
const { presignedUrl } = await WelshareApi.fetchS3ReadDelegation(
keypair,
storageKey,
resolveEnvironment("production")
);
// Download encrypted file
const response = await fetch(presignedUrl);
const encryptedData = await response.arrayBuffer();
Fetch a presigned URL for downloading encrypted files from S3 storage.