forgetproof Try the button

The embed snippet

One element beside a memory. The host page serves /forget-me/v1 behind it (the host contract) and issues an opaque reference per memory item when the agent stores it. No signing key, no admin token, no central account, no telemetry; the person's sign-in is the host page's own.

<script type="module" src="/forget-me/button/forget-me-button.js"></script>

<forget-me-button reference="fmr_…" endpoint="/forget-me/v1" label="Home address">
  Forget this
</forget-me-button>

Self-host the three files from /forget-me/button/ (forget-me-button.js, http-host.js, outcomes.js) in one folder; the element imports the other two by relative path. The package forgetme-button is unreleased: not on npm.

The element calls the four routes under endpoint on your page's own origin, with the page's own session. This demo's host answers only its own origin, so a page elsewhere cannot point at it directly: serve your page behind your own server, proxy the four routes to this demo with the Bearer credential from POST /pim/sessions, or open a sample host here. Until a server answers, a press opens a dialog that reads "Could not continue" and ends "Nothing was changed". The client quickstart walks through it.

The complete example page

The package's example/embed.html (raw), with one path changed: the example imports the element from the package's own src/ folder, and here that is /forget-me/button/. It needs a host behind /forget-me/v1 and a real reference; the two sample hosts here are such pages: a memory list and a chat.

<!doctype html>
<!-- The minimal embed. Serve this page from the same origin as your ForgetMe endpoint (the person's
     sign-in is your page's own cookie), or point `endpoint` at it and send credentials yourself
     through a ForgetMeHost. Nothing here needs a signing key, a token, an account or a build step. -->
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>ForgetMe embed</title>
<script type="module" src="/forget-me/button/forget-me-button.js"></script>
<style>
  body { font: 16px/1.5 system-ui, sans-serif; margin: 40px auto; max-width: 560px; padding: 0 16px; color: #111827; }
  .memory { display: flex; gap: 12px; align-items: center; border: 1px solid #e5e7eb; border-radius: 12px; padding: 12px 14px; }
  .memory q { flex: 1; }
  /* styling hooks: custom properties and parts */
  forget-me-button { --forgetme-accent: #0f766e; }
  forget-me-button::part(button) { border-radius: 999px; }
</style>
</head>
<body>
<h1>One memory, one button</h1>
<div class="memory">
  <q>John's home address is 118 Harbor Lane, Oakland CA 94607.</q>
  <!-- `reference` is the opaque, item-specific token the agent issued when it stored this memory.
       `label` names the item for screen readers. `scope` is "item" unless the host says "account". -->
  <forget-me-button reference="fmr_REPLACE_WITH_THE_ITEMS_REFERENCE" endpoint="/forget-me/v1" label="Home address">
    Forget this
    <span slot="confirm-label">Yes, forget it</span>
  </forget-me-button>
</div>
<p id="out"></p>
<script type="module">
  // The four events a host listens to.
  const out = document.getElementById("out");
  for (const type of ["forgetme:preview", "forgetme:confirmed", "forgetme:cancelled", "forgetme:result"]) {
    document.addEventListener(type, (e) => {
      out.textContent = type === "forgetme:result" ? e.detail.outcome?.sentence ?? e.detail.operation.state : type;
    });
  }
</script>
</body>
</html>

What a host listens to

Four events bubble from the element: forgetme:preview, forgetme:confirmed, forgetme:cancelled, forgetme:result (and forgetme:evidence when a receipt is opened). The guide lists their payloads; walkthrough.mjs drives the same five host methods without the element.