Skip to content

Commit 48cc3e0

Browse files
authored
Merge branch 'master' into ss-admin-auth-features
2 parents ade2115 + af67fa9 commit 48cc3e0

File tree

27 files changed

+2331
-1489
lines changed

27 files changed

+2331
-1489
lines changed

auth/package-lock.json

Lines changed: 87 additions & 158 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

auth/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
"compile": "cp ../tsconfig.json.template ./tsconfig.json && tsc"
99
},
1010
"dependencies": {
11-
"firebase-admin": "^8.11.0"
11+
"firebase-admin": "^8.12.1"
1212
}
1313
}

config/index.js

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
const admin = require('firebase-admin');
2+
admin.initializeApp();
3+
4+
// [START validate_template]
5+
function validateTemplate(template) {
6+
admin.remoteConfig().validateTemplate(template)
7+
.then(function (validatedTemplate) {
8+
// The template is valid and safe to use.
9+
console.log('Template was valid and safe to use');
10+
})
11+
.catch(function (err) {
12+
console.error('Template is invalid and cannot be published');
13+
console.error(err);
14+
});
15+
}
16+
// [END validate_template]
17+
18+
// [START add_new_condition]
19+
function addNewCondition(template) {
20+
template.conditions.push({
21+
name: 'android_en',
22+
expression: 'device.os == \'android\' && device.country in [\'us\', \'uk\']',
23+
tagColor: 'BLUE',
24+
});
25+
}
26+
// [END add_new_condition]
27+
28+
// [START set_modify_parameter]
29+
function setOrModifyParameter(template) {
30+
// Set header_text parameter.
31+
template.parameters['header_text'] = {
32+
defaultValue: {
33+
value: 'A Gryffindor must be brave, talented and helpful.'
34+
},
35+
conditionalValues: {
36+
android_en: {
37+
value: 'A Droid must be brave, talented and helpful.'
38+
},
39+
},
40+
};
41+
}
42+
// [END set_modify_parameter]
43+
44+
// [START set_modify_parameter_group]
45+
function setOrModifyParameterGroup(template) {
46+
// Set new_menu parameter group
47+
template.parameterGroups['new_menu'] = {
48+
description: 'Description of the group.',
49+
parameters: {
50+
pumpkin_spice_season: {
51+
defaultValue: {
52+
value: 'A Gryffindor must love a pumpkin spice latte.'
53+
},
54+
conditionalValues: {
55+
android_en: {
56+
value: 'A Droid must love a pumpkin spice latte.'
57+
},
58+
},
59+
description: 'Description of the parameter.',
60+
},
61+
},
62+
};
63+
}
64+
// [END set_modify_parameter_group]
65+
66+
// [START add_parameter_to_group]
67+
function addParameterToGroup(template) {
68+
template.parameterGroups['new_menu'].parameters['spring_season'] = {
69+
defaultValue: {
70+
useInAppDefault: true
71+
},
72+
description: 'spring season menu visibility.',
73+
};
74+
}
75+
// [END add_parameter_to_group]

0 commit comments

Comments
 (0)