Store user files from a browser app without a server

Seige stores files for a browser app in the user's own account. Files are encrypted in the browser before upload. Your app does not create a storage bucket, run an upload server, sign URLs or write access rules.

import { createSeige } from "@seige_sdk/sdk";

const seige = createSeige({ appName: "Receipts" });

input.onchange = async () => {
  const file = input.files[0];
  const { error } = await seige.files.put(`receipts/${file.name}`, file);
  if (error) showMessage(error.hint ?? error.message);
};

const { data: entries } = await seige.files.list("receipts/");
const { data: blob } = await seige.files.get("receipts/september.pdf");

How file storage behaves

Users can open the files in Seige Files

Files your app saves appear in the app's folder in Seige Files, the file manager in the user's account. File names and metadata are encrypted too. If the user stops using your app, the files stay in their account.

Reading the user's other folders

An app reaches only its own folder by default. To read folders the user already has, ask when the feature needs them. Seige shows a window where the user chooses which folders to share, and the call returns the folders they selected.

const { data: shared } = await seige.request({ access: "read" });
// shared is a list such as [{ folder: "…folder ID…" }]

Limits

This guide is also available as Markdown for coding agents.