File tree Expand file tree Collapse file tree 8 files changed +31
-47
lines changed
full-text-search/functions Expand file tree Collapse file tree 8 files changed +31
-47
lines changed Original file line number Diff line number Diff line change 13
13
* See the License for the specific language governing permissions and
14
14
* limitations under the License.
15
15
*/
16
-
16
+ 'use strict' ;
17
17
// [START get_service_account_tokens]
18
- var admin = require ( " firebase-admin" ) ;
18
+ const admin = require ( ' firebase-admin' ) ;
19
19
20
- var serviceAccount = require ( " path/to/serviceAccountKey.json" ) ;
21
- var credential = admin . credential . cert ( serviceAccount ) ;
20
+ const serviceAccount = require ( ' path/to/serviceAccountKey.json' ) ;
21
+ const credential = admin . credential . cert ( serviceAccount ) ;
22
22
23
- credential . getAccessToken ( ) . then ( function ( accessTokenInfo ) {
24
- var accessToken = accessTokenInfo . access_token ;
25
- var expirationTime = accessTokenInfo . expires_in ;
23
+ credential . getAccessToken ( ) . then ( ( accessTokenInfo ) => {
24
+ const accessToken = accessTokenInfo . access_token ;
25
+ const expirationTime = accessTokenInfo . expires_in ;
26
26
27
27
// Attach accessToken to HTTPS request in the "Authorization: Bearer" header
28
28
// After expirationTime, you must generate a new access token
29
29
// [START_EXCLUDE]
30
- console . log ( " The token " + accessToken + " expires in " + expirationTime ) ;
30
+ console . log ( ` The token ${ accessToken } expires in ${ expirationTime } ` ) ;
31
31
// [END_EXCLUDE]
32
32
} ) ;
33
33
// [END get_service_account_tokens]
Original file line number Diff line number Diff line change 1
1
{
2
- "name" : " snippets-node" ,
2
+ "name" : " snippets-node-auth " ,
3
3
"version" : " 1.0.0" ,
4
4
"description" : " Code snippets used in Node.js documentation on firebase.google.com" ,
5
5
"author" : " Firebase (https://firebase.google.com/)" ,
Original file line number Diff line number Diff line change 3
3
"description" : " Full text search for Firestore" ,
4
4
"dependencies" : {
5
5
"algoliasearch" : " ^3.24.0" ,
6
- "firebase-admin" : " ^4.1.2 " ,
7
- "firebase-functions" : " ^0.5.8 " ,
8
- "@google-cloud/firestore" : " file:../../firestore-0.6.6.tgz "
6
+ "firebase-admin" : " ^5.4.0 " ,
7
+ "firebase-functions" : " ^0.7.0 " ,
8
+ "@google-cloud/firestore" : " ^0.8.0 "
9
9
},
10
10
"private" : true ,
11
11
"devDependencies" : {
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 10
10
"author" : " " ,
11
11
"license" : " ISC" ,
12
12
"dependencies" : {
13
- "@google-cloud/firestore" : " file:firestore.tgz " ,
14
- "firebase-admin" : " file:firebase-admin.tgz "
13
+ "@google-cloud/firestore" : " ^0.8.0 " ,
14
+ "firebase-admin" : " ^5.4.0 "
15
15
},
16
16
"devDependencies" : {
17
17
"mocha" : " ^3.3.0"
Original file line number Diff line number Diff line change
1
+ # Firestore Presence
2
+
3
+ Demonstrates using Realtime Database presence with Cloud Firestore.
Original file line number Diff line number Diff line change
1
+ test.js
Original file line number Diff line number Diff line change
1
+ {
2
+ "name" : " presence" ,
3
+ "description" : " Presence for Firestore" ,
4
+ "dependencies" : {
5
+ "firebase-admin" : " ^5.4.0" ,
6
+ "firebase-functions" : " ^0.7.0" ,
7
+ "@google-cloud/firestore" : " ^0.8.0"
8
+ },
9
+ "private" : true ,
10
+ "devDependencies" : {
11
+ "prettier" : " ^1.6.1"
12
+ }
13
+ }
You can’t perform that action at this time.
0 commit comments