Skip to content

Commit

Permalink
pass Client-SDK HTTP header
Browse files Browse the repository at this point in the history
This will only work when pointed to the next version of the SDK.

J=SLAP-1949
TEST=manual,auto

see that the test-site specifies the theme's version in the header
create a fresh jambo site using the hitchhiker theme, see the header passed as expected
  • Loading branch information
oshi97 committed Mar 16, 2022
1 parent 96b34f8 commit a9cbba1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion hooks/templatedataformatter.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const getCleanedJamboInjectedData = require('../static/webpack/getCleanedJamboInjectedData');
const packageJson = require('../package.json');

/**
* Formats the data sent to the handlebars templates during Jambo builds.
Expand All @@ -25,7 +26,8 @@ module.exports = function (pageMetadata, siteLevelAttributes, pageNameToConfig)
params: currentLocaleConfig.params || {},
relativePath,
env: {
JAMBO_INJECTED_DATA: env.JAMBO_INJECTED_DATA
JAMBO_INJECTED_DATA: env.JAMBO_INJECTED_DATA,
packageJsonVersion: packageJson.version
}
};
if (globalConfig.useJWT) {
Expand Down
3 changes: 3 additions & 0 deletions script/core.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
{{#with env.JAMBO_INJECTED_DATA}}
{{#if businessId}}businessId: "{{businessId}}",{{/if}}
{{/with}}
customClientSdk: {
ANSWERS_THEME: '{{{ env.packageJsonVersion }}}'
}
};
const userConfig = {
{{#with (deepMerge global_config (lookup verticalsToConfig verticalKey) pageSettings) }}
Expand Down

0 comments on commit a9cbba1

Please sign in to comment.