Quickstart

This walks through the smallest working integration: requesting an upload slot from your backend and handing it to the client SDK.

1. Create a slot on your backend

A slot is a short-lived, scoped target for one upload. Your server creates it after checking whatever auth and quota rules apply to that user.

// server const slot = await vaultframe.slots.create({ owner: user.id, maxBytes: 200_000_000, accept: ["image/*", "video/mp4"], expiresIn: "10m", }); return { token: slot.token };

2. Upload from the client

The SDK handles chunking and retries. Pass it the token from step one and a progress callback if you want one.

// client await Vaultframe.upload(file, token, { onProgress: (pct) => setProgress(pct), });

3. Receive the webhook

Once every chunk is confirmed and checksummed, Vaultframe calls your webhook with the final object reference.

// webhook payload { "event": "object.stored", "objectId": "obj_8f2a1c", "region": "eu-central", "bytes": 18452110 }

Idempotency

Slot creation accepts an optional idempotencyKey. Retrying a slot request with the same key returns the original slot instead of minting a new one, which matters for flaky client networks retrying the initial handshake.