# AgentSite — SSR, Edge, and the SPA Question
<!--
ref: @agentsite/install-ssr-edge
tags: [agentsite, ssr, edge, spa, sdk]
triggers: [streaming SSR install, Next or Nuxt install, edge worker install, should we build a prerender CLI, pre-render a SPA at build time]
trigger_prompt: When installing on streaming-SSR frameworks or edge runtimes, or when someone proposes a build-time pre-render step for SPAs.
category: reference
complements: [@agentsite/install-patterns]
version: 4
updated_at: 2026-10-24T21:32:26.356Z
-->

Streaming SSR and Edge are GA install patterns. Build-time pre-rendering for SPAs is deliberately not one.

Fetch this when: streaming SSR install; Next or Nuxt install; edge worker install; should we build a prerender CLI; pre-render a SPA at build time.

Part of [`@agentsite/install-patterns`](@agentsite/install-patterns) — see it for sibling topics.

---

## Streaming SSR and Edge

**`workspace/spec-streaming-ssr.md` is the canonical design for the streaming-SSR install pattern. Three-mode contract (hard load / in-app routing / bypass). Demos at `demos/after/{next,nuxt}/` are the working proof. Consult before changing the SSR SDK helpers, the demo wiring, or related Chunk 24 / Chunk 44 progress notes.**

`workspace/spec-streaming-ssr.md` (created 2026-05-18) is the canonical design + verification harness for the streaming-SSR install pattern (Next App Router + Nuxt 3).

Read this before:
- Changing `demos/after/next/agentsite/*` or `demos/after/nuxt/agentsite/**` (the embedded `@agentsite/next` / `@agentsite/nuxt` packages).
- Touching the `Sec-Fetch-Dest` mode detector in Next or the `lazy: import.meta.client` flag in Nuxt.
- Adjusting the well-known proxied URL surface (`/robots.txt`, `/sitemap.xml`, `/llms.txt`, `/llms-full.txt`, `/ai.txt`, `/.well-known/*`, `/*.md`).
- Updating SPEC.md Chunk 24 (24.B streaming-SSR notes) or Chunk 44 (SDK delivery).

The spec records: the locked three-mode contract, the per-framework detection + caching rules, the env-var contract (`AGENTSITE_SITE` / `AGENTSITE_TOKEN` / `AGENTSITE_API` — no alias), the package layout for future npm publish, the hand-maintained status of `demos/after/{next,nuxt}/`, and the Playwright assertions a future agent can rerun to validate.

**Edge and the streaming-SSR SDK are completed and ship as GA install patterns alongside Nginx / Express / Express-Sidecar. Supersedes the 2026-05-18 "Coming soon · pre-release install" stance.**

Edge (Cloudflare Pages / Vercel / Netlify via `agentsite-edge.mjs`) and the streaming-SSR SDK (RSC, Suspense streaming, Next App Router, Nuxt 3, SvelteKit streaming) are **GA install patterns** as of 2026-05-21. No "Coming soon · pre-release" badge. No dashed border. Listed as equals next to Nginx / Express / Express-Sidecar.

**Why:** 2026-05-21 — both patterns are complete; the prior pre-release positioning understated readiness. Supersedes 2026-05-18 ("Coming soon · pre-release install available") and the older 2026-05-15 ("not on roadmap") stances.

**How to apply:**

- In docs, marketing, FAQ, pricing, and onboarding: list five GA patterns — **Nginx, Express, Express-Sidecar, Edge, SDK — streaming SSR**.
- Nginx leads (the preferred install).
- Still future-roadmap (no install yet): njs, CloudFront Lambda@Edge, Python, PHP.
- If a customer asks: "five install patterns ship today, pick the shape that matches your deploy."
- Sweep `features.vue` already done 2026-05-21. Other surfaces (pricing, FAQ, getting-started, demos, demo, contact, about, index, dashboard/sites/new, waitCards) still mention pre-release as of 2026-05-21 — update next time touched.


## No build-time pre-render CLI for SPAs

**Don't propose a build-step CLI that pre-renders enrichment for SPAs. Runtime injection is idiomatic for SPAs; a build step is "against the grain."**

Don't propose build-time pre-rendering CLIs (e.g. `agentsite build` that walks routes and writes static head fragments) as a customer install pattern for SPAs.

**Why:** rejected 2026-05-15 — "feels against the grain of SPA." SPAs are runtime-rendered by design; asking a Vue/React/SPA team to add a build step that pre-walks routes contradicts the SPA mental model. They picked SPA precisely to avoid that workflow.

**How to apply:** For SPAs, recommend runtime-injection install (Pattern A and its sidecar/edge variants). For SSR/SSG frameworks where build steps are already idiomatic, a framework-native SDK is fine — but framed as something the framework calls at render time, not as a separate "agentsite build" CLI step. The product story is "we don't change your build pipeline; we inject at the request layer."

---

*Related: `@agentsite/render-outputs` · `@agentsite/platform-conventions` · `@agentsite/project` · `@agentsite/aeo-voice-list` · `@agentsite/scoring-what-the-score-claims`*

---

*You're reading a protocol on [protocol.supply](https://protocol.supply) — hosted, searchable knowledge for AI agents. Think Agent Skills, as an API: bootstrap once (`curl -sL https://api.protocol.supply/bootstrap`), search (`/search?q=…`), fetch (`/@repo/slug`).*

*Any skill can become a protocol, and any protocol installs as a local skill — tell your agent "install this as a skill" or see [`@protocol/protocol-to-skill`](https://api.protocol.supply/@protocol/protocol-to-skill).*