zedkit
@zedtech/zedkit-storage

Sanitise keys and presign uploads

Block `..` and control characters; optional `keyPrefix` from config.

alpha

At a glance

  • Who: Handlers that accept user filenames and return short-lived upload URLs.
  • What: Block .. and control characters; optional keyPrefix from config.
  • Use when: Direct-to-storage uploads from the browser or mobile app.
  • Avoid when: Public anonymous buckets without presigning — configure IAM separately.

Install

pnpm add @zedtech/zedkit-storage

Latest: 0.1.0 (via changesets).

Example

Usage
import { presignPutUrl, sanitizeFilename } from "@zedtech/zedkit-storage";
const safe = sanitizeFilename(userName);
await presignPutUrl(client, config, { key: `${userId}/${safe}`, contentType: "image/png" });

Wraps: @aws-sdk/s3-request-presigner (peer)

On this page