#Firebase Authentication With Custom Fastify Backend
1 messages · Page 1 of 1 (latest)
Hi @junior heart. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
Based on the information provided in the knowledge sources, I don't have enough specific details to fully answer your question about implementing Firebase authentication in Next.js 15 with verification on a Fastify backend. However, I can provide some general insights related to Firebase authentication in Next.js:
-
Firebase authentication is supported in Next.js, but there are some limitations when using it in certain contexts like middleware. According to a GitHub issue discussion, Firebase uses the Node.js runtime which is not supported by Next.js middleware GitHub Issue (https://github.com/vercel/next.js/issues/67260).
-
For authentication in Next.js applications, it's generally recommended to use established authentication providers or solutions. Firebase is listed as one of the supported authentication providers for Next.js Vercel Guide on Application Authentication (https://vercel.com/guides/application-authentication-on-vercel#application-authentication-on-vercel).
-
When implementing custom authentication flows, it's crucial to handle authentication securely. This often involves verifying user credentials on the server-side, which aligns with your intention to verify on a backend Next.js Docs on Authentication (https://nextjs.org/docs/pages/building-your-application/authentication#implementing-authentication).
-
For integrating with a custom backend (like your Fastify server), you might need to create custom API routes in Next.js to communicate with your Fastify backend for authentication verification.
To implement this specific setup with Firebase, Next.js 15, and a Fastify backend, you would likely need to combine Firebase client-side authentication with server-side token verification. However, the exact implementation details would require more specific documentation or examples that are not provided in the given knowledge sources.