Bring your own backend
Delete
delete — remove an object by key.
delete removes one object. Unlike upload and download, this is a direct
mutation — not a presigned client-to-S3 call.
The payload is a single object: route and key.
Prop
Type
Prop
Type
import type { DeletePayload, DeleteResponse } from "@dimah-s3/core";Example
Add this to the defineApi skeleton.
@dimah-s3/server uses DELETE /api/s3/delete?route=…&key=….
async delete(payload) {
const params = new URLSearchParams({
route: payload.route,
key: payload.key,
});
const res = await fetch(`/api/files/delete?${params}`, { method: "DELETE" });
if (!res.ok) throw new Error(await res.text());
return res.json();
}