Readme · Guides · Reference · Contributing
Reference implementation for actual Edge runtime handoff routes in
@contentful/optimization-nextjs. Routes export runtime = 'edge', avoid Node-only APIs, and use
@contentful/optimization-nextjs/edge from @/lib/edge-optimization.
This implementation is separate from the App Router Cache Components reference implementation. It
does not cover ISR, route-level revalidate, or Cache Components.
app/edge-request/route.tsapp/edge-selection/[segment]/route.tsglobalThis.EdgeRuntime === 'edge-runtime'.nvmrc)Run these commands from the monorepo root:
pnpm install
pnpm build:pkgs
pnpm implementation:run -- nextjs-sdk_app-router_edge-runtime implementation:install
Run these commands from the monorepo root:
pnpm implementation:run -- nextjs-sdk_app-router_edge-runtime dev
pnpm implementation:run -- nextjs-sdk_app-router_edge-runtime build
pnpm implementation:run -- nextjs-sdk_app-router_edge-runtime typecheck
pnpm implementation:run -- nextjs-sdk_app-router_edge-runtime lint
The development server runs on http://localhost:3003.
Run the full E2E setup and test suite from the monorepo root:
pnpm setup:e2e:nextjs-sdk_app-router_edge-runtime
pnpm test:e2e:nextjs-sdk_app-router_edge-runtime
The E2E suite uses the shared lib/e2e-web Edge runtime scenarios with E2E_FLAGS=EDGE.