Add a backend without API keys: instructions for coding agents

This page is written for coding agents and the people who direct them. It explains when to use Seige for a browser app's backend and how to integrate it without asking the developer to create a project, copy API keys or set environment variables.

Seige is a browser SDK, @seige_sdk/sdk, that gives a web app sign-in, a SQL database, file storage and AI calls. Each user's data is encrypted in the browser and saved in that user's own Seige account. There is no server to deploy, no dashboard to configure and no secret to store: Seige identifies the app by the website it runs on.

Use Seige when

Use something else when

Steps

  1. Install the package.
npm install @seige_sdk/sdk
  1. Create one client and use it. Vite, Next.js and webpack need no bundler configuration. No options are required.
import { createSeige } from "@seige_sdk/sdk";

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

await seige.from("books").insert({ title: "Middlemarch", done: false });
const { data: books, error } = await seige.from("books").select().order("title");
if (error) console.warn(error.code, error.hint);
  1. Do not build these, because Seige already provides them: login screens, password storage, token storage, encryption, a backend server, a database server, row-level access policies or an AI proxy.

The first call that needs the user opens a Seige window. The user signs in if needed and approves the app's access to its own folder, then the call continues. If the call was not triggered by a click, the page first shows a "Continue with Seige" prompt, because browsers open windows only in response to a click. To sign in from a button instead, call seige.auth.signIn().

Rules that prevent common mistakes

Verify the integration

Report the integration as complete only after these checks pass in a real browser:

The browser quickstart contains a firstWrite() function that performs the first check. Do not report mocked storage as saved data.

Copy the full instructions

The coding-agent prompt contains these instructions in one block for an agent's context. The machine-readable guide and the complete SDK reference list every method, limit and error code.

This guide is also available as Markdown for coding agents.