Simple Firebase authentication packages for React frontend and Cloud Functions backend.
React hooks and components for Firebase authentication with Google Sign-In.
$ npm install @nearform/simple-firebase-auth-frontendor
<script type="importmap">
{
"imports": {
// ...
"@nearform/simple-firebase-auth-frontend": "https://esm.sh/@nearform/simple-firebase-auth-frontend"
}
}
</script>Fastify adapter for Firebase Cloud Functions with authentication middleware.
$ npm install @nearform/simple-firebase-auth-backendYou must initialize Firebase yourself. We don't call initializeApp() or admin.initializeApp().
$ npm install
$ npm run formatBoth packages support Firebase emulators:
$ firebase emulators:startConnect frontend to emulator:
import { connectAuthEmulator } from "firebase/auth";
if (window.location.hostname === "localhost") {
connectAuthEmulator(auth, "http://127.0.0.1:9099", { disableWarnings: true });
}Backend works automatically with emulator when using admin.initializeApp() locally.
MIT