<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/streamline-ssr-app-development-m50j221ms" -->

---
title: Streamline SSR app development | daily.dev
description: Firebase&#x27;s Web SDK now includes FirebaseServerApp, a new FirebaseApp variant that lets client-authenticated Auth sessions be shared with Node.js SSR rendering...
canonical: https://daily.dev/posts/streamline-ssr-app-development-m50j221ms
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Streamline SSR app development | daily.dev
og:description: Firebase&#x27;s Web SDK now includes FirebaseServerApp, a new FirebaseApp variant that lets client-authenticated Auth sessions be shared with Node.js SSR rendering...
og:url: https://daily.dev/posts/streamline-ssr-app-development-m50j221ms
og:image: https://api.daily.dev/og/posts/M50J221Ms.png
og:image:alt: Streamline SSR app development
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Streamline SSR app development

**[Firebase](https://daily.dev/sources/firebase-blog)** · 6 min read · 0 upvotes · 0 comments

## Summary

Firebase's Web SDK now includes FirebaseServerApp, a new FirebaseApp variant that lets client-authenticated Auth sessions be shared with Node.js SSR rendering phases, available starting with Firebase JS SDK 10.10.0. It bridges CSR and SSR auth state via an Auth ID token, avoiding duplicated sign-in logic. The post covers usage patterns: initializing with authIdToken, awaiting authStateReady() before accessing user-dependent resources, handling a null currentUser, and cleaning up via reference counting or the releaseOnDeref option, with a Next.js example.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://firebase.blog/posts/2024/05/firebase-serverapp-ssr>

## Questions this post answers

### How do I share a Firebase Auth session between client-side and server-side rendering in Next.js?

Use FirebaseServerApp, introduced in the Firebase JavaScript SDK starting at version 10.10.0. Initialize it with initializeServerApp() passing an authIdToken pulled from the request headers, then call getAuth() on the resulting app and await authStateReady() before checking auth.currentUser, redirecting to a sign-in page if it is null.

_daily.dev surfaces SDK updates like this for developers wiring up SSR authentication flows._

### Why does FirebaseServerApp initialization not return a promise I can await for sign-in?

Initializing FirebaseServerApp returns immediately and attempts to sign in the user behind the scenes without exposing a promise to await, unlike standard Firebase Auth sign-in calls. To ensure a user is actually signed in before accessing storage or database operations, call and await FirebaseAuth.authStateReady() or use the onAuthStateChanged handler instead.

_Track Firebase Auth quirks like this on daily.dev before they cause race conditions in production._

### When should I delete a FirebaseServerApp instance in an SSR app?

FirebaseServerApp uses reference counting, so creating a new instance with identical parameters returns the same object and increments its reference count instead of creating a duplicate. Call FirebaseServerApp.delete() to decrement the count and mark it for deletion at zero, or use the releaseOnDeref option to auto-decrement when a related object like the request is garbage collected.

_Developers cleaning up SSR resource lifecycles can follow Firebase API changes on daily.dev._

## Similar posts on daily.dev

- [Streaming SSR in Next.js: A Deep, Beginner-Friendly Guide for Production Apps](https://daily.dev/posts/streaming-ssr-in-next-js-a-deep-beginner-friendly-guide-for-production-apps-5qirbgtda) · Medium · 3 upvotes · 0 comments
- [Handling Auth in Next.js 16 with Server Actions and Middleware](https://daily.dev/posts/handling-auth-in-next-js-16-with-server-actions-and-middleware-isvz1eirv) · Auth0 · 11 upvotes · 0 comments

---

Tags: [#webdev](https://daily.dev/tags/webdev), [#javascript](https://daily.dev/tags/javascript), [#authentication](https://daily.dev/tags/authentication), [#nextjs](https://daily.dev/tags/nextjs), [#firebase](https://daily.dev/tags/firebase)

[View this post on daily.dev](https://daily.dev/posts/streamline-ssr-app-development-m50j221ms)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Streamline SSR app development","url":"https://daily.dev/posts/streamline-ssr-app-development-m50j221ms","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/streamline-ssr-app-development-m50j221ms"},"datePublished":"2026-08-23T12:18:24.855Z","dateModified":"2026-08-24T06:56:59.544Z","description":"Firebase's Web SDK now includes FirebaseServerApp, a new FirebaseApp variant that lets client-authenticated Auth sessions be shared with Node.js SSR rendering...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/85d932f921a891ec4b15b34d52cc0191?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/85d932f921a891ec4b15b34d52cc0191?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Firebase","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Firebase","logo":"https://media.daily.dev/image/upload/s--i395oqZH--/f_auto,q_auto/v1787487448/logos/firebase-blog?_a=BAMAMicg0","url":"https://daily.dev/sources/firebase-blog"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/streamline-ssr-app-development-m50j221ms","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"webdev,javascript,authentication,nextjs,firebase","timeRequired":"PT6M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Firebase","item":"https://daily.dev/sources/firebase-blog"},{"@type":"ListItem","position":3,"name":"Streamline SSR app development"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/streamline-ssr-app-development-m50j221ms#faq","mainEntity":[{"@type":"Question","name":"How do I share a Firebase Auth session between client-side and server-side rendering in Next.js?","acceptedAnswer":{"@type":"Answer","text":"Use FirebaseServerApp, introduced in the Firebase JavaScript SDK starting at version 10.10.0. Initialize it with initializeServerApp() passing an authIdToken pulled from the request headers, then call getAuth() on the resulting app and await authStateReady() before checking auth.currentUser, redirecting to a sign-in page if it is null. daily.dev surfaces SDK updates like this for developers wiring up SSR authentication flows."}},{"@type":"Question","name":"Why does FirebaseServerApp initialization not return a promise I can await for sign-in?","acceptedAnswer":{"@type":"Answer","text":"Initializing FirebaseServerApp returns immediately and attempts to sign in the user behind the scenes without exposing a promise to await, unlike standard Firebase Auth sign-in calls. To ensure a user is actually signed in before accessing storage or database operations, call and await FirebaseAuth.authStateReady() or use the onAuthStateChanged handler instead. Track Firebase Auth quirks like this on daily.dev before they cause race conditions in production."}},{"@type":"Question","name":"When should I delete a FirebaseServerApp instance in an SSR app?","acceptedAnswer":{"@type":"Answer","text":"FirebaseServerApp uses reference counting, so creating a new instance with identical parameters returns the same object and increments its reference count instead of creating a duplicate. Call FirebaseServerApp.delete() to decrement the count and mark it for deletion at zero, or use the releaseOnDeref option to auto-decrement when a related object like the request is garbage collected. Developers cleaning up SSR resource lifecycles can follow Firebase API changes on daily.dev."}}]}
```

