Skip to content

Commit 39cda2c

Browse files
committed
Remote config
1 parent eba953d commit 39cda2c

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

config/index.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
const admin = require('firebase-admin');
2-
admin.initializeApp();
1+
import { initializeApp } from 'firebase-admin/app';
2+
import { getRemoteConfig } from 'firebase-admin/remote-config';
3+
initializeApp();
34

45
// [START validate_template]
56
function validateTemplate(template) {
6-
admin.remoteConfig().validateTemplate(template)
7-
.then(function (validatedTemplate) {
7+
getRemoteConfig().validateTemplate(template)
8+
.then((validatedTemplate) => {
89
// The template is valid and safe to use.
910
console.log('Template was valid and safe to use');
1011
})
11-
.catch(function (err) {
12+
.catch((err) => {
1213
console.error('Template is invalid and cannot be published');
1314
console.error(err);
1415
});

0 commit comments

Comments
 (0)