GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — docs(app-check): explain App Check during server rendering by armando-navarro · Pull Request #3775 · angular/angularfire

Conversation

@armando-navarro

@armando-navarro armando-navarro commented Sep 28, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

Fixes #3774
Refs #3256

Adds a "Server-side rendering" section to docs/app-check.md for the behavior #3773 introduced. #3773's development-mode warning links to this page.

Changes

  • Explains that AngularFire does not create an App Check instance during server rendering, and that inject(AppCheck) returns null there although its type says AppCheck.
  • Explains that Firebase requests made during server rendering carry no App Check token, and links Firebase's recommended appCheckToken route for products that enforce App Check.
  • Shows the APP_CHECK_ON_SERVER opt-in in a full app.config.server.ts.
  • For 21.0.0-rc.1 and earlier, shows a browser-only config that keeps provideAppCheck off the server, with inject(AppCheck, { optional: true }).

Verification

Followed the section literally in a new ng new --ssr Angular 21 app:

  • 21.0.0-rc.1, the Dependency Injection setup as written: ng build fails with ReferenceError: document is not defined, as the section says.
  • 21.0.0-rc.1, the browser-only config: the build succeeds, AppCheck is null on the server, and App Check starts in the browser.
  • A canary built from main after fix(app-check)!: skip App Check during server rendering by default #3773, the Dependency Injection setup as written: the build succeeds and AppCheck is null on the server.
  • The same canary with the APP_CHECK_ON_SERVER snippet as written: it compiles, and App Check runs on the server.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@armando-navarro
docs(app-check): explain App Check during server rendering
62c3aab
The App Check guide said nothing about server-rendered apps. angular#3773
stops AngularFire from creating an App Check instance during server
rendering, so the new section explains that inject(AppCheck) is null
there, that Firebase requests made while rendering carry no App Check
token, and how to opt back in with APP_CHECK_ON_SERVER. It also shows
a browser-only config for 21.0.0-rc.1 and earlier, where the guide's
setup fails with "document is not defined".
@armando-navarro
armando-navarro requested a review from tyler-reitz September 28, 2026 03:57
@armando-navarro armando-navarro added this to the 21.0.0 milestone Sep 28, 2026
@armando-navarro armando-navarro added comp: app-check App Check (src/app-check). comp: docs Documentation. comp: ssr Server-side rendering, hydration, @angular/ssr interop. target: major type: chore Maintenance with no user-facing behavior change. labels Sep 28, 2026
tyler-reitz
tyler-reitz approved these changes Sep 28, 2026
View reviewed changes

@tyler-reitz tyler-reitz left a comment

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved.

The null-on-server behavior is covered by the toBeNull() specs in app-check.spec.ts, and CI ran them green on this branch. I did not rerun the rc.1 document is not defined case; I confirmed from source that 21.0.0-rc.1's app-check.module.ts has no server skip, which is consistent with it.

Optional, not blocking: #3773's dev-mode warning links here, but the section never uses the warning's wording, so a reader arriving from the console has nothing to match.

One flag on the hold: this approval alone makes it mergeable. Branch protection is an aggregator, so the approval is the only real gate.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@armando-navarro armando-navarro added bump: patch Size of the change: a fix or docs change that reaches users and removed target: major labels Oct 1, 2026
@armando-navarro
docs(app-check): use the dev-mode warning's wording in the SSR section
cb948f9
The warning AngularFire prints during server rendering says it skips App Check there. The section now opens with the same words, so a reader arriving from the console finds them.
@armando-navarro

armando-navarro commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator Author

The section now opens with the warning's own words: "App Check's reCAPTCHA providers need a browser, so AngularFire skips App Check during server rendering."

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@armando-navarro
Merge branch 'main' into b32-app-check-ssr-docs
b990fee
@armando-navarro
armando-navarro marked this pull request as ready for review October 10, 2026 04:53
@armando-navarro
Merge branch 'main' into b32-app-check-ssr-docs
9c79796
@armando-navarro
armando-navarro merged commit f020821 into angular:main Oct 10, 2026
24 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@armando-navarro armando-navarro modified the milestones: 21.0.0, 21.0.0-rc.2 Oct 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@tyler-reitz tyler-reitz tyler-reitz approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

bump: patch Size of the change: a fix or docs change that reaches users comp: app-check App Check (src/app-check). comp: docs Documentation. comp: ssr Server-side rendering, hydration, @angular/ssr interop. type: chore Maintenance with no user-facing behavior change.

Projects

None yet

Milestone

21.0.0-rc.2

Development

Successfully merging this pull request may close these issues.

docs: the App Check guide does not cover server-side rendering

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@armando-navarro @tyler-reitz
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.