The user's session keypair for authentication
The document ID of the binary file to delete
The Welshare API environment configuration
Promise containing presignedUrl (S3 DELETE URL), storageKey, and binaryFileId
import { WelshareApi, resolveEnvironment } from "@welshare/sdk";
const { presignedUrl } = await WelshareApi.fetchS3DeleteDelegation(
keypair,
"abc-123-def-456",
resolveEnvironment("production")
);
// Call the presigned URL to delete from S3
await fetch(presignedUrl, { method: "DELETE" });
Side effects:
{apiUrl}/auth/delegate/storage?requestType=deleteSecurity notes:
Fetch a presigned URL for deleting a binary file from S3 storage.
This is the delegation approach - it returns a presigned DELETE URL that the client can call directly. For complete deletion (both Nillion and S3), use
deleteBinaryFile()instead.