angular-ssr

Implement server-side rendering, hydration, and prerendering in Angular v20+ applications.

Updated Feb 9, 2026
One-click install
npx skills add https://github.com/Blotch-Smart-Frames/Board --skill angular-ssr-blotch-smart-frames
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: angular-ssr
Source: https://github.com/Blotch-Smart-Frames/Board/tree/main/packages/client/.claude/skills/angular-ssr
Command: npx skills add https://github.com/Blotch-Smart-Frames/Board --skill angular-ssr-blotch-smart-frames

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @angular/ssr, @angular/platform-server, @angular/platform-browser, express, and includes references (resource) components.

What problem does it solve? Angular single-page apps render entirely in the browser, which hurts SEO, slows first paint, and breaks when code touches browser-only APIs on the server. This Skill guides you through adding SSR, hydration, and prerendering to an Angular v20+ project so pages render on the server without hydration mismatches. ## Core Features & Use Cases - SSR Setup & Configuration: Add @angular/ssr to an existing project, configure app.config.server.ts, and define per-route render modes (Prerender, Server, Client). - Hydration Strategies: Apply incremental hydration with @defer triggers (viewport, interaction, idle, timer), enable event replay, and debug hydration mismatches. - Browser-Only API Handling: Guard window, document, and localStorage access using PLATFORM_ID, afterNextRender, and injection tokens so code runs safely on both server and client. - Use Case: You have an e-commerce Angular app where product pages need SEO-friendly static HTML, but the dashboard must stay client-only. Use this Skill to prerender product routes with getPrerenderParams, SSR dynamic pages, and mark authenticated routes as RenderMode.Client. ## Quick Start Add server-side rendering to my Angular project and configure the product detail route to prerender at build time.

Frequently Asked Questions about angular-ssr

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add server-side rendering to an existing Angular project?▼

Run ng add @angular/ssr to add server-side rendering to an existing Angular project. This installs the @angular/ssr package and generates server.ts, main.server.ts, and app.config.server.ts while updating angular.json with SSR configuration.

How to fix Angular hydration mismatch errors?▼

Hydration mismatches occur when server-rendered HTML differs from client rendering, often from values like new Date(). Move dynamic values into afterNextRender, use signals updated after render, or add ngSkipHydration to skip hydration for dynamic subtrees.

What is the difference between RenderMode.Prerender, Server, and Client in Angular?▼

RenderMode.Prerender generates static HTML at build time for marketing pages, RenderMode.Server renders dynamically per request for user-specific content, and RenderMode.Client keeps the route as a client-side SPA for authenticated dashboards.

Can I use window or localStorage in an Angular SSR app?▼

Browser APIs like window and localStorage are unavailable on the server and must be guarded. Check isPlatformBrowser with PLATFORM_ID, run DOM code inside afterNextRender, or inject them through InjectionToken factories that return null on the server.

How do I prerender dynamic routes with parameters in Angular?▼

Use getPrerenderParams on a server route to return parameter objects for each page to prerender, such as fetching product IDs from an API. Set a PrerenderFallback option (Server, Client, or None) to control handling of non-prerendered paths.

Why is my Angular SSR app making duplicate HTTP requests?▼

Duplicate requests happen when the client refetches data the server already loaded. Enable withHttpTransferCacheOptions in provideClientHydration to transfer server HTTP responses to the client, or use TransferState manually with makeStateKey.