angular-ssr
Guides for Angular SSR implementation, including hydration and render modes.
Install
mkdir -p .claude/skills/angular-ssr && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/10795" && unzip -o skill.zip -d .claude/skills/angular-ssr && rm skill.zipInstalls to .claude/skills/angular-ssr
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Implement Angular SSR with hydration, TransferState caching, and per-route render modes. Use when configuring Angular Universal SSR, client hydration, static prerendering, or preventing double-fetching. (triggers: **/*.server.ts, server.ts, hydration, transferState, afterNextRender, isPlatformServer, RenderMode)Key capabilities
- →Enable hydration
- →Configure SSR render modes
- →Implement TransferState caching
- →Guard browser-only code
How it works
Configures Angular SSR, hydration, and render modes to optimize server-side rendering.
Inputs & outputs
When to use angular-ssr
- →Enable hydration in Angular
- →Configure server-side rendering modes
- →Implement TransferState caching
About this skill
SSR (Server-Side Rendering)
Priority: P2 (MEDIUM)
1. Enable Hydration
- Run
ng add @angular/ssr. - Add
provideClientHydration(withEventReplay())toapp.config.tsproviders.
See hydration examples for app config and hydration setup.
2. Guard Browser-Only Code
- Use
afterNextRender(() => { /* window access */ })for one-time browser-only code. - For recurring checks, inject
PLATFORM_IDand useisPlatformBrowser(platformId).
3. Prevent Double-Fetching
- Use
withHttpTransferCacheOptions()or manualTransferStateto cache server responses for client replay.
4. Configure Render Modes (Angular 17+)
Export ServerRoute[] in app.routes.server.ts:
- RenderMode.Prerender — Static HTML at build time (blogs, marketing).
- RenderMode.Server — Dynamic SSR per request (user-specific pages).
- RenderMode.Client — Client-only SPA (authenticated dashboards).
5. Incremental Hydration (Angular 19+)
- Defer hydration with
@defer (hydrate on viewport). - Triggers:
viewport,interaction,idle,timer(ms),immediate,never. - Add
withEventReplay()to capture user events before hydration completes.
Anti-Patterns
- No direct window/document access: Use
afterNextRender()orPLATFORM_IDcheck. - No double-fetching: Use
withHttpTransferCacheOptions()orTransferState. - No SSR for auth-gated pages: Set
RenderMode.Clientfor authenticated dashboards.
References
When not to use it
- →Client-only SPA development
Prerequisites
Limitations
- →No direct window/document access allowed
How it compares
Provides structured SSR configuration instead of manual setup.
Compared to similar skills
angular-ssr side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| angular-ssr (this skill) | 0 | 4mo | No flags | Intermediate |
| angular | 100 | 4mo | Review | Advanced |
| angular-best-practices | 21 | 3mo | No flags | Advanced |
| angular-state-management | 8 | 4mo | No flags | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by li-lance
View all by li-lance →You might also like
angular
sickn33
Modern Angular (v20+) expert with deep knowledge of Signals, Standalone Components, Zoneless applications, SSR/Hydration, and reactive patterns. Use PROACTIVELY for Angular development, component architecture, state management, performance optimization, and migration to modern patterns.
angular-best-practices
sickn33
Angular performance optimization and best practices guide. Use when writing, reviewing, or refactoring Angular code for optimal performance, bundle size, and rendering efficiency.
angular-state-management
sickn33
Master modern Angular state management with Signals, NgRx, and RxJS. Use when setting up global state, managing component stores, choosing between state solutions, or migrating from legacy patterns.
angular-ui-patterns
sickn33
Modern Angular UI patterns for loading states, error handling, and data display. Use when building UI components, handling async data, or managing component states.
angular-modernization
bitwarden
Modernizes Angular code such as components and directives to follow best practices using both automatic CLI migrations and Bitwarden-specific patterns. YOU must use this skill when someone requests modernizing Angular code. DO NOT invoke for general Angular discussions unrelated to modernization.
angular-routing
analogjs
Implement routing in Angular v20+ applications with lazy loading, functional guards, resolvers, and route parameters. Use for navigation setup, protected routes, route-based data loading, and nested routing. Triggers on route configuration, adding authentication guards, implementing lazy loading, or reading route parameters with signals.