Setup Firebase Admin
firebase.server.ts
We use the Firebase Admin SDK server-side to verify our user's login JWT token and create a session cookie. Create ./app/utils/firebase.server.ts
import * as admin from "firebase-admin";import { initializeApp } from "firebase-admin/app";if (admin.apps.length === 0) {initializeApp({credential: admin.credential.cert(JSON.parse(process.env.FIREBASE_ADMIN_SERVICE_ACCOUNT!)),});}export { admin };
Did you find this page helpful?
Start with GraphQL on Hasura for Free
- Build apps and APIs 10x faster
- Built-in authorization and caching
- 8x more performant than hand-rolled APIs