-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfirebase.js
More file actions
24 lines (20 loc) · 911 Bytes
/
Copy pathfirebase.js
File metadata and controls
24 lines (20 loc) · 911 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const admin = require('firebase-admin');
require('dotenv').config();
const private_key = (process.env.FIREBASE_PRIVATE_KEY || '').replace(/\\n/g, '\n');
const serviceAccount = {
"type": "service_account",
"project_id": "nameflame",
"private_key_id": process.env.FIREBASE_PRIVATE_KEY_ID,
"private_key": private_key,
"client_email": "nameflameserver@nameflame.iam.gserviceaccount.com",
"client_id": process.env.FIREBASE_CLIENT_ID,
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/nameflameserver%40nameflame.iam.gserviceaccount.com",
"universe_domain": "googleapis.com"
};
admin.initializeApp({
credential: admin.credential.cert(serviceAccount),
});
module.exports = admin;