My end goal is to get user email, using user's id. So far I figured out I need to use the firebase admin SDK. Right now I have this code:
var admin = require("firebase-admin");
var serviceAccount = require("./serviceAccountKey");
admin.initializeApp({
credential: admin.credential.cert(serviceAccount),
databaseURL: "https://zdajtotestdb.firebaseio.com"
});
export default admin;
The serviceAccountKey is the file I downloaded from my firebase project here (Sorry it's in Polish)
I tried using this video as a tutorial/reference
And right now, when I try to do anything I get this in the npm start console:
20:22-48 Critical dependency: the request of a dependency is an expression
./node_modules/google-gax/node_modules/grpc/src/grpc_extension.js 32:12-33 Critical dependency: the request of a dependency is an expression ./node_modules/hash-stream-validation/index.js Module not found: Can't resolve 'fast-crc32c' in '/home/iron/Documents?>/Projects/zdajto-admin-panel/node_modules/hash-stream-validation'
Search for the keywords to learn more about each warning. To ignore, add // eslint-disable-next-line to the line before.
And this in the browser console:
Error fetching user data: Error: "Credential implementation provided to initializeApp() via the "credential" property failed to fetch a valid Google OAuth2 access token with the following error: "Failed to parse access token response: Error: Error while making request: XHR error. Error code: undefined"."
What am I missing?