diff --git a/examples/nextjs-ssr/.eslintrc.json b/examples/nextjs-ssr/.eslintrc.json
new file mode 100644
index 000000000..c9515dbe1
--- /dev/null
+++ b/examples/nextjs-ssr/.eslintrc.json
@@ -0,0 +1,9 @@
+{
+ "extends": ["next/core-web-vitals"],
+ "parser": "@typescript-eslint/parser",
+ "plugins": ["@typescript-eslint"],
+ "rules": {
+ "@typescript-eslint/no-explicit-any": "warn",
+ "no-console": "off"
+ }
+}
diff --git a/examples/nextjs-ssr/.firebaserc b/examples/nextjs-ssr/.firebaserc
new file mode 100644
index 000000000..043e32416
--- /dev/null
+++ b/examples/nextjs-ssr/.firebaserc
@@ -0,0 +1,5 @@
+{
+ "projects": {
+ "default": "fir-ui-rework"
+ }
+}
diff --git a/examples/nextjs-ssr/.gitignore b/examples/nextjs-ssr/.gitignore
new file mode 100644
index 000000000..577f1099d
--- /dev/null
+++ b/examples/nextjs-ssr/.gitignore
@@ -0,0 +1,44 @@
+# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
+
+# dependencies
+/node_modules
+/.pnp
+.pnp.*
+.yarn/*
+!.yarn/patches
+!.yarn/plugins
+!.yarn/releases
+!.yarn/versions
+
+# testing
+/coverage
+
+# next.js
+/.next/
+/out/
+
+# production
+/build
+
+# misc
+.DS_Store
+*.pem
+
+# debug
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+.pnpm-debug.log*
+
+# env files (can opt-in for committing if needed)
+.env*
+
+# vercel
+.vercel
+
+# firebase
+.firebase
+
+# typescript
+*.tsbuildinfo
+next-env.d.ts
diff --git a/examples/nextjs-ssr/.prettierrc b/examples/nextjs-ssr/.prettierrc
new file mode 100644
index 000000000..37702140f
--- /dev/null
+++ b/examples/nextjs-ssr/.prettierrc
@@ -0,0 +1,9 @@
+{
+ "semi": true,
+ "trailingComma": "es5",
+ "singleQuote": false,
+ "printWidth": 120,
+ "tabWidth": 2,
+ "useTabs": false,
+ "endOfLine": "auto"
+}
diff --git a/examples/nextjs-ssr/README.md b/examples/nextjs-ssr/README.md
new file mode 100644
index 000000000..d3ba7a191
--- /dev/null
+++ b/examples/nextjs-ssr/README.md
@@ -0,0 +1,54 @@
+This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app) configured for **Server-Side Rendering (SSR)**.
+
+This example demonstrates how to use Firebase UI with Next.js App Router using server-side rendering. Unlike the static export version (`nextjs`), this version uses Next.js SSR capabilities including:
+
+- Server Components for initial page rendering
+- Server-side authentication state checking using `getCurrentUser()` from `serverApp.ts`
+- Server-side redirects using `redirect()` from `next/navigation`
+
+## Getting Started
+
+First, run the development server:
+
+```bash
+npm run dev
+# or
+yarn dev
+# or
+pnpm dev
+# or
+bun dev
+```
+
+Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
+
+You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
+
+This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.
+
+## Differences from Static Export Version
+
+- **No `output: "export"`** in `next.config.ts` - enables SSR
+- **Server Components** - Pages use `async` functions and `getCurrentUser()` from `serverApp.ts`
+- **Server-side redirects** - Uses `redirect()` instead of client-side `useRouter().push()`
+- **Server-side auth checks** - Authentication state is checked on the server before rendering
+
+## Learn More
+
+To learn more about Next.js, take a look at the following resources:
+
+- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
+- [Next.js Server Components](https://nextjs.org/docs/app/building-your-application/rendering/server-components) - learn about server-side rendering
+- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
+
+You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!
+
+## Deploy
+
+This app can be deployed to Firebase Hosting or any Node.js hosting platform that supports Next.js SSR:
+
+```bash
+pnpm run deploy
+```
+
+For Firebase Hosting, ensure you have configured the hosting site `fir-ui-2025-nextjs-ssr` in your Firebase project.
diff --git a/examples/nextjs-ssr/app/favicon.ico b/examples/nextjs-ssr/app/favicon.ico
new file mode 100644
index 000000000..718d6fea4
Binary files /dev/null and b/examples/nextjs-ssr/app/favicon.ico differ
diff --git a/examples/nextjs-ssr/app/forgot-password/page.tsx b/examples/nextjs-ssr/app/forgot-password/page.tsx
new file mode 100644
index 000000000..2bcef1e86
--- /dev/null
+++ b/examples/nextjs-ssr/app/forgot-password/page.tsx
@@ -0,0 +1,29 @@
+/**
+ * Copyright 2025 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { getCurrentUser } from "@/lib/firebase/serverApp";
+import { redirect } from "next/navigation";
+import ForgotPasswordScreen from "./screen";
+
+export default async function ForgotPasswordPage() {
+ const { currentUser } = await getCurrentUser();
+
+ if (currentUser) {
+ redirect("/");
+ }
+
+ return ;
+}
diff --git a/examples/nextjs-ssr/app/forgot-password/screen.tsx b/examples/nextjs-ssr/app/forgot-password/screen.tsx
new file mode 100644
index 000000000..acda21245
--- /dev/null
+++ b/examples/nextjs-ssr/app/forgot-password/screen.tsx
@@ -0,0 +1,26 @@
+/**
+ * Copyright 2025 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+"use client";
+
+import { ForgotPasswordAuthScreen } from "@invertase/firebaseui-react";
+import { useRouter } from "next/navigation";
+
+export default function Screen() {
+ const router = useRouter();
+
+ return router.push("/sign-in")} />;
+}
diff --git a/examples/nextjs-ssr/app/globals.css b/examples/nextjs-ssr/app/globals.css
new file mode 100644
index 000000000..7e62d3ba8
--- /dev/null
+++ b/examples/nextjs-ssr/app/globals.css
@@ -0,0 +1,21 @@
+/**
+ * Copyright 2025 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+@import "tailwindcss";
+@import "@invertase/firebaseui-styles/tailwind";
+
+/* @import "@invertase/firebaseui-styles/themes/dark.css"; */
+/* @import "@invertase/firebaseui-styles/themes/brutalist.css"; */
diff --git a/examples/nextjs-ssr/app/layout.tsx b/examples/nextjs-ssr/app/layout.tsx
new file mode 100644
index 000000000..bea3a80e7
--- /dev/null
+++ b/examples/nextjs-ssr/app/layout.tsx
@@ -0,0 +1,55 @@
+/**
+ * Copyright 2025 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { getCurrentUser } from "@/lib/firebase/serverApp";
+import type { Metadata } from "next";
+import { Geist, Geist_Mono } from "next/font/google";
+
+import { Header } from "@/lib/components/header";
+import { FirebaseUIProviderHoc } from "@/lib/firebase/ui";
+import "./globals.css";
+
+const geistSans = Geist({
+ variable: "--font-geist-sans",
+ subsets: ["latin"],
+});
+
+const geistMono = Geist_Mono({
+ variable: "--font-geist-mono",
+ subsets: ["latin"],
+});
+
+export const metadata: Metadata = {
+ title: "Create Next App (SSR)",
+ description: "Generated by create next app with SSR",
+};
+
+export default async function RootLayout({
+ children,
+}: Readonly<{
+ children: React.ReactNode;
+}>) {
+ const { currentUser } = await getCurrentUser();
+
+ return (
+
+
+
+ {children}
+
+
+ );
+}
diff --git a/examples/nextjs-ssr/app/page.tsx b/examples/nextjs-ssr/app/page.tsx
new file mode 100644
index 000000000..85aefa3f9
--- /dev/null
+++ b/examples/nextjs-ssr/app/page.tsx
@@ -0,0 +1,89 @@
+/**
+ * Copyright 2025 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { getCurrentUser } from "@/lib/firebase/serverApp";
+import Link from "next/link";
+
+export default async function Home() {
+ const { currentUser } = await getCurrentUser();
+
+ return (
+
+ );
+}
diff --git a/examples/nextjs-ssr/app/register/page.tsx b/examples/nextjs-ssr/app/register/page.tsx
new file mode 100644
index 000000000..608d50d7a
--- /dev/null
+++ b/examples/nextjs-ssr/app/register/page.tsx
@@ -0,0 +1,29 @@
+/**
+ * Copyright 2025 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { getCurrentUser } from "@/lib/firebase/serverApp";
+import { redirect } from "next/navigation";
+import RegisterScreen from "./screen";
+
+export default async function RegisterPage() {
+ const { currentUser } = await getCurrentUser();
+
+ if (currentUser) {
+ redirect("/");
+ }
+
+ return ;
+}
diff --git a/examples/nextjs-ssr/app/register/screen.tsx b/examples/nextjs-ssr/app/register/screen.tsx
new file mode 100644
index 000000000..d53d41292
--- /dev/null
+++ b/examples/nextjs-ssr/app/register/screen.tsx
@@ -0,0 +1,40 @@
+/**
+ * Copyright 2025 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+"use client";
+
+import { useUser } from "@/lib/firebase/hooks";
+import { GoogleSignInButton, SignUpAuthScreen } from "@invertase/firebaseui-react";
+import { useRouter } from "next/navigation";
+import { useEffect } from "react";
+
+export default function Screen() {
+ const router = useRouter();
+ const user = useUser();
+
+ // If the user signs in, redirect to the home page from the client.
+ useEffect(() => {
+ if (user) {
+ router.push("/");
+ }
+ }, [user, router]);
+
+ return (
+ router.push("/sign-in")}>
+
+
+ );
+}
diff --git a/examples/nextjs-ssr/app/screens/email-link-auth-screen-w-oauth/page.tsx b/examples/nextjs-ssr/app/screens/email-link-auth-screen-w-oauth/page.tsx
new file mode 100644
index 000000000..2886c4113
--- /dev/null
+++ b/examples/nextjs-ssr/app/screens/email-link-auth-screen-w-oauth/page.tsx
@@ -0,0 +1,27 @@
+/**
+ * Copyright 2025 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+"use client";
+
+import { EmailLinkAuthScreen, GoogleSignInButton } from "@invertase/firebaseui-react";
+
+export default function EmailLinkAuthScreenWithOAuthPage() {
+ return (
+
+
+
+ );
+}
diff --git a/examples/nextjs-ssr/app/screens/email-link-auth-screen/page.tsx b/examples/nextjs-ssr/app/screens/email-link-auth-screen/page.tsx
new file mode 100644
index 000000000..532261734
--- /dev/null
+++ b/examples/nextjs-ssr/app/screens/email-link-auth-screen/page.tsx
@@ -0,0 +1,23 @@
+/**
+ * Copyright 2025 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+"use client";
+
+import { EmailLinkAuthScreen } from "@invertase/firebaseui-react";
+
+export default function EmailLinkAuthScreenPage() {
+ return ;
+}
diff --git a/examples/nextjs-ssr/app/screens/forgot-password-auth-screen/page.tsx b/examples/nextjs-ssr/app/screens/forgot-password-auth-screen/page.tsx
new file mode 100644
index 000000000..d0cd87312
--- /dev/null
+++ b/examples/nextjs-ssr/app/screens/forgot-password-auth-screen/page.tsx
@@ -0,0 +1,24 @@
+/**
+
+ * Copyright 2025 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+"use client";
+
+import { ForgotPasswordAuthScreen } from "@invertase/firebaseui-react";
+
+export default function ForgotPasswordAuthScreenPage() {
+ return {}} />;
+}
diff --git a/examples/nextjs-ssr/app/screens/oauth-screen/page.tsx b/examples/nextjs-ssr/app/screens/oauth-screen/page.tsx
new file mode 100644
index 000000000..46872be1e
--- /dev/null
+++ b/examples/nextjs-ssr/app/screens/oauth-screen/page.tsx
@@ -0,0 +1,27 @@
+/**
+ * Copyright 2025 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+"use client";
+
+import { GoogleSignInButton, OAuthScreen } from "@invertase/firebaseui-react";
+
+export default function OAuthScreenPage() {
+ return (
+
+
+
+ );
+}
diff --git a/examples/nextjs-ssr/app/screens/password-reset-screen/page.tsx b/examples/nextjs-ssr/app/screens/password-reset-screen/page.tsx
new file mode 100644
index 000000000..d400ee5f8
--- /dev/null
+++ b/examples/nextjs-ssr/app/screens/password-reset-screen/page.tsx
@@ -0,0 +1,23 @@
+/**
+ * Copyright 2025 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+"use client";
+
+import { ForgotPasswordAuthScreen } from "@invertase/firebaseui-react";
+
+export default function PasswordResetScreenPage() {
+ return {}} />;
+}
diff --git a/examples/nextjs-ssr/app/screens/phone-auth-screen-w-oauth/page.tsx b/examples/nextjs-ssr/app/screens/phone-auth-screen-w-oauth/page.tsx
new file mode 100644
index 000000000..abb815b59
--- /dev/null
+++ b/examples/nextjs-ssr/app/screens/phone-auth-screen-w-oauth/page.tsx
@@ -0,0 +1,27 @@
+/**
+ * Copyright 2025 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+"use client";
+
+import { GoogleSignInButton, PhoneAuthScreen } from "@invertase/firebaseui-react";
+
+export default function PhoneAuthScreenWithOAuthPage() {
+ return (
+
+
+
+ );
+}
diff --git a/examples/nextjs-ssr/app/screens/phone-auth-screen/page.tsx b/examples/nextjs-ssr/app/screens/phone-auth-screen/page.tsx
new file mode 100644
index 000000000..980cb9362
--- /dev/null
+++ b/examples/nextjs-ssr/app/screens/phone-auth-screen/page.tsx
@@ -0,0 +1,23 @@
+/**
+ * Copyright 2025 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+"use client";
+
+import { PhoneAuthScreen } from "@invertase/firebaseui-react";
+
+export default function PhoneAuthScreenPage() {
+ return ;
+}
diff --git a/examples/nextjs-ssr/app/screens/sign-in-auth-screen-w-handlers/page.tsx b/examples/nextjs-ssr/app/screens/sign-in-auth-screen-w-handlers/page.tsx
new file mode 100644
index 000000000..d457b7ad8
--- /dev/null
+++ b/examples/nextjs-ssr/app/screens/sign-in-auth-screen-w-handlers/page.tsx
@@ -0,0 +1,29 @@
+/**
+ * Copyright 2025 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+"use client";
+
+import { SignInAuthScreen } from "@invertase/firebaseui-react";
+
+export default function SignInAuthScreenWithHandlersPage() {
+ return (
+ {
+ console.log(credential);
+ }}
+ />
+ );
+}
diff --git a/examples/nextjs-ssr/app/screens/sign-in-auth-screen-w-oauth/page.tsx b/examples/nextjs-ssr/app/screens/sign-in-auth-screen-w-oauth/page.tsx
new file mode 100644
index 000000000..4789f1f98
--- /dev/null
+++ b/examples/nextjs-ssr/app/screens/sign-in-auth-screen-w-oauth/page.tsx
@@ -0,0 +1,35 @@
+/**
+ * Copyright 2025 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+"use client";
+
+import { GoogleSignInButton, SignInAuthScreen } from "@invertase/firebaseui-react";
+import { useRouter } from "next/navigation";
+
+export default function SignInAuthScreenWithOAuthPage() {
+ const router = useRouter();
+
+ return (
+ router.push("/password-reset-screen")}
+ onSignIn={() => {
+ router.push("/");
+ }}
+ >
+
+
+ );
+}
diff --git a/examples/nextjs-ssr/app/screens/sign-in-auth-screen/page.tsx b/examples/nextjs-ssr/app/screens/sign-in-auth-screen/page.tsx
new file mode 100644
index 000000000..9952a1f3a
--- /dev/null
+++ b/examples/nextjs-ssr/app/screens/sign-in-auth-screen/page.tsx
@@ -0,0 +1,23 @@
+/**
+ * Copyright 2025 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+"use client";
+
+import { SignInAuthScreen } from "@invertase/firebaseui-react";
+
+export default function SignInAuthScreenPage() {
+ return ;
+}
diff --git a/examples/nextjs-ssr/app/screens/sign-up-auth-screen-w-oauth/page.tsx b/examples/nextjs-ssr/app/screens/sign-up-auth-screen-w-oauth/page.tsx
new file mode 100644
index 000000000..4c649f2e9
--- /dev/null
+++ b/examples/nextjs-ssr/app/screens/sign-up-auth-screen-w-oauth/page.tsx
@@ -0,0 +1,27 @@
+/**
+ * Copyright 2025 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+"use client";
+
+import { GoogleSignInButton, SignUpAuthScreen } from "@invertase/firebaseui-react";
+
+export default function SignUpAuthScreenWithOAuthPage() {
+ return (
+
+
+
+ );
+}
diff --git a/examples/nextjs-ssr/app/screens/sign-up-auth-screen/page.tsx b/examples/nextjs-ssr/app/screens/sign-up-auth-screen/page.tsx
new file mode 100644
index 000000000..04b840189
--- /dev/null
+++ b/examples/nextjs-ssr/app/screens/sign-up-auth-screen/page.tsx
@@ -0,0 +1,23 @@
+/**
+ * Copyright 2025 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+"use client";
+
+import { SignUpAuthScreen } from "@invertase/firebaseui-react";
+
+export default function SignUpAuthScreenPage() {
+ return ;
+}
diff --git a/examples/nextjs-ssr/app/sign-in/email/page.tsx b/examples/nextjs-ssr/app/sign-in/email/page.tsx
new file mode 100644
index 000000000..4d5d64fdb
--- /dev/null
+++ b/examples/nextjs-ssr/app/sign-in/email/page.tsx
@@ -0,0 +1,29 @@
+/**
+ * Copyright 2025 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { getCurrentUser } from "@/lib/firebase/serverApp";
+import { redirect } from "next/navigation";
+import EmailLinkAuthScreen from "./screen";
+
+export default async function SignInWithEmailLinkPage() {
+ const { currentUser } = await getCurrentUser();
+
+ if (currentUser) {
+ redirect("/");
+ }
+
+ return ;
+}
diff --git a/examples/nextjs-ssr/app/sign-in/email/screen.tsx b/examples/nextjs-ssr/app/sign-in/email/screen.tsx
new file mode 100644
index 000000000..3251fe345
--- /dev/null
+++ b/examples/nextjs-ssr/app/sign-in/email/screen.tsx
@@ -0,0 +1,37 @@
+/**
+ * Copyright 2025 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+"use client";
+
+import { useUser } from "@/lib/firebase/hooks";
+import { EmailLinkAuthScreen } from "@invertase/firebaseui-react";
+
+import { useRouter } from "next/navigation";
+import { useEffect } from "react";
+
+export default function Screen() {
+ const router = useRouter();
+ const user = useUser();
+
+ // If the user signs in, redirect to the home page from the client.
+ useEffect(() => {
+ if (user) {
+ router.push("/");
+ }
+ }, [user, router]);
+
+ return ;
+}
diff --git a/examples/nextjs-ssr/app/sign-in/page.tsx b/examples/nextjs-ssr/app/sign-in/page.tsx
new file mode 100644
index 000000000..dd8ac829f
--- /dev/null
+++ b/examples/nextjs-ssr/app/sign-in/page.tsx
@@ -0,0 +1,29 @@
+/**
+ * Copyright 2025 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { getCurrentUser } from "@/lib/firebase/serverApp";
+import { redirect } from "next/navigation";
+import SignInScreen from "./screen";
+
+export default async function SignInPage() {
+ const { currentUser } = await getCurrentUser();
+
+ if (currentUser) {
+ redirect("/");
+ }
+
+ return ;
+}
diff --git a/examples/nextjs-ssr/app/sign-in/phone/page.tsx b/examples/nextjs-ssr/app/sign-in/phone/page.tsx
new file mode 100644
index 000000000..142be9778
--- /dev/null
+++ b/examples/nextjs-ssr/app/sign-in/phone/page.tsx
@@ -0,0 +1,29 @@
+/**
+ * Copyright 2025 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { getCurrentUser } from "@/lib/firebase/serverApp";
+import { redirect } from "next/navigation";
+import SignInWithPhoneNumberScreen from "./screen";
+
+export default async function SignInWithPhoneNumberPage() {
+ const { currentUser } = await getCurrentUser();
+
+ if (currentUser) {
+ redirect("/");
+ }
+
+ return ;
+}
diff --git a/examples/nextjs-ssr/app/sign-in/phone/screen.tsx b/examples/nextjs-ssr/app/sign-in/phone/screen.tsx
new file mode 100644
index 000000000..6e7cfd2bf
--- /dev/null
+++ b/examples/nextjs-ssr/app/sign-in/phone/screen.tsx
@@ -0,0 +1,37 @@
+/**
+ * Copyright 2025 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+"use client";
+
+import { useUser } from "@/lib/firebase/hooks";
+import { PhoneAuthScreen } from "@invertase/firebaseui-react";
+
+import { useRouter } from "next/navigation";
+import { useEffect } from "react";
+
+export default function Screen() {
+ const router = useRouter();
+ const user = useUser();
+
+ // If the user signs in, redirect to the home page from the client.
+ useEffect(() => {
+ if (user) {
+ router.push("/");
+ }
+ }, [user, router]);
+
+ return ;
+}
diff --git a/examples/nextjs-ssr/app/sign-in/screen.tsx b/examples/nextjs-ssr/app/sign-in/screen.tsx
new file mode 100644
index 000000000..3d304b91c
--- /dev/null
+++ b/examples/nextjs-ssr/app/sign-in/screen.tsx
@@ -0,0 +1,51 @@
+/**
+ * Copyright 2025 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+"use client";
+
+import { useUser } from "@/lib/firebase/hooks";
+import { GoogleSignInButton, SignInAuthScreen } from "@invertase/firebaseui-react";
+import Link from "next/link";
+
+import { useRouter } from "next/navigation";
+import { useEffect } from "react";
+
+export default function Screen() {
+ const router = useRouter();
+ const user = useUser();
+
+ // If the user signs in, redirect to the home page from the client.
+ useEffect(() => {
+ if (user) {
+ router.push("/");
+ }
+ }, [user, router]);
+
+ return (
+ router.push("/forgot-password")}
+ onSignIn={() => router.push("/register")}
+ >
+
+
+ Sign in with phone number
+
+
+ Sign in with email link
+
+
+ );
+}
diff --git a/examples/nextjs-ssr/firebase.json b/examples/nextjs-ssr/firebase.json
new file mode 100644
index 000000000..8a4b9898c
--- /dev/null
+++ b/examples/nextjs-ssr/firebase.json
@@ -0,0 +1,7 @@
+{
+ "hosting": {
+ "site": "fir-ui-rework-nextjs-ssr",
+ "source": ".",
+ "ignore": ["firebase.json", "**/.*", "**/node_modules/**"]
+ }
+}
diff --git a/examples/nextjs-ssr/lib/components/header.tsx b/examples/nextjs-ssr/lib/components/header.tsx
new file mode 100644
index 000000000..87b44c796
--- /dev/null
+++ b/examples/nextjs-ssr/lib/components/header.tsx
@@ -0,0 +1,56 @@
+/**
+ * Copyright 2025 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+"use client";
+
+import { signOut, type User } from "firebase/auth";
+import Link from "next/link";
+import { useRouter } from "next/navigation";
+import { auth } from "../firebase/clientApp";
+import { useUser } from "../firebase/hooks";
+
+export function Header(props: { currentUser?: User | null }) {
+ const router = useRouter();
+ const user = useUser(props.currentUser || null);
+
+ async function onSignOut() {
+ await signOut(auth);
+ router.push("/sign-in");
+ }
+
+ return (
+
+