File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 16
16
'use strict' ;
17
17
18
18
// [START imports]
19
- var firebase = require ( 'firebase' ) ;
19
+ var firebase = require ( 'firebase-admin ' ) ;
20
20
// [END imports]
21
21
var nodemailer = require ( 'nodemailer' ) ;
22
22
var schedule = require ( 'node-schedule' ) ;
@@ -32,9 +32,11 @@ var mailTransport = nodemailer.createTransport('smtps://<user>%40gmail.com:<pass
32
32
// TODO(DEVELOPER): Change the two placeholders below.
33
33
// [START initialize]
34
34
// Initialize the app with a service account, granting admin privileges
35
+ var serviceAccount = require ( "path/to/serviceAccountKey.json" ) ;
36
+
35
37
firebase . initializeApp ( {
36
- databaseURL : 'https://<PROJECT_ID>.firebaseio.com' ,
37
- serviceAccount : '<PATH_TO_SERVICE_ACCOUNT_CREDENTIAL_FILE> '
38
+ credential : firebase . credential . cert ( serviceAccount ) ,
39
+ databaseURL : 'https://<PROJECT_ID>.firebaseio.com '
38
40
} ) ;
39
41
// [END initialize]
40
42
Original file line number Diff line number Diff line change 7
7
"license" : " Apache License Version 2.0" ,
8
8
"dependencies" : {
9
9
"escape-html" : " ^1.0.3" ,
10
- "firebase" : " ^3.5.1 " ,
10
+ "firebase-admin " : " ^4.0.3 " ,
11
11
"node-schedule" : " ^1.1.0" ,
12
12
"nodemailer" : " ^2.4.1" ,
13
13
"promise" : " ^7.1.1"
You can’t perform that action at this time.
0 commit comments