File tree Expand file tree Collapse file tree
app/lib/utilities/getEnvConfig
server/Document/Renderers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,6 +23,9 @@ AWS_EMF_SERVICE_NAME=Simorgh
2323AWS_EMF_LOG_GROUP_NAME = SimorghServer
2424AWS_EMF_ENVIRONMENT = EC2
2525
26+ # Reverb Reporting
27+ SIMORGH_REVERB_SOURCE = https://mybbc-analytics.files.bbci.co.uk/reverb-client-js/reverb-3.9.2.js
28+
2629# # WebVitals Reporting
2730SIMORGH_WEBVITALS_REPORTING_ENDPOINT = https://ws.bbc-reporting-api.app/report-endpoint
2831SIMORGH_WEBVITALS_DEFAULT_SAMPLING_RATE = 20
Original file line number Diff line number Diff line change @@ -23,6 +23,9 @@ AWS_EMF_SERVICE_NAME=Simorgh
2323AWS_EMF_LOG_GROUP_NAME = SimorghServer
2424AWS_EMF_ENVIRONMENT = Local
2525
26+ # Reverb Reporting
27+ SIMORGH_REVERB_SOURCE = https://mybbc-analytics.files.bbci.co.uk/reverb-client-js/reverb-3.9.2.js
28+
2629# # WebVitals Reporting
2730SIMORGH_WEBVITALS_REPORTING_ENDPOINT = https://ws.bbc-reporting-api.app/report-endpoint
2831SIMORGH_WEBVITALS_DEFAULT_SAMPLING_RATE = 100
Original file line number Diff line number Diff line change @@ -23,6 +23,9 @@ AWS_EMF_SERVICE_NAME=Simorgh
2323AWS_EMF_LOG_GROUP_NAME = SimorghServer
2424AWS_EMF_ENVIRONMENT = EC2
2525
26+ # Reverb Reporting
27+ SIMORGH_REVERB_SOURCE = https://mybbc-analytics.files.bbci.co.uk/reverb-client-js/reverb-3.9.2.js
28+
2629# # WebVitals Reporting
2730SIMORGH_WEBVITALS_REPORTING_ENDPOINT = https://ws.bbc-reporting-api.app/report-endpoint
2831SIMORGH_WEBVITALS_DEFAULT_SAMPLING_RATE = 100
Original file line number Diff line number Diff line change @@ -23,6 +23,9 @@ AWS_EMF_SERVICE_NAME=Simorgh
2323AWS_EMF_LOG_GROUP_NAME = SimorghServer
2424AWS_EMF_ENVIRONMENT = EC2
2525
26+ # Reverb Reporting
27+ SIMORGH_REVERB_SOURCE = https://mybbc-analytics.files.bbci.co.uk/reverb-client-js/reverb-3.9.2.js
28+
2629# # WebVitals Reporting
2730SIMORGH_WEBVITALS_REPORTING_ENDPOINT = https://ws.bbc-reporting-api.app/report-endpoint
2831SIMORGH_WEBVITALS_DEFAULT_SAMPLING_RATE = 100
Original file line number Diff line number Diff line change @@ -23,6 +23,9 @@ AWS_EMF_SERVICE_NAME=Simorgh
2323AWS_EMF_LOG_GROUP_NAME = SimorghServer
2424AWS_EMF_ENVIRONMENT = EC2
2525
26+ # Reverb Reporting
27+ SIMORGH_REVERB_SOURCE = https://mybbc-analytics.files.bbci.co.uk/reverb-client-js/reverb-3.9.2.js
28+
2629# # WebVitals Reporting
2730SIMORGH_WEBVITALS_REPORTING_ENDPOINT = https://ws.bbc-reporting-api.app/report-endpoint
2831SIMORGH_WEBVITALS_DEFAULT_SAMPLING_RATE = 100
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ export const getProcessEnvAppVariables = () => ({
2323 process . env . SIMORGH_PUBLIC_STATIC_ASSETS_ORIGIN ,
2424 SIMORGH_PUBLIC_STATIC_ASSETS_PATH :
2525 process . env . SIMORGH_PUBLIC_STATIC_ASSETS_PATH ,
26+ SIMORGH_REVERB_SOURCE : process . env . SIMORGH_REVERB_SOURCE ,
2627 SIMORGH_WEBVITALS_REPORTING_ENDPOINT :
2728 process . env . SIMORGH_WEBVITALS_REPORTING_ENDPOINT ,
2829 SIMORGH_WEBVITALS_DEFAULT_SAMPLING_RATE :
Original file line number Diff line number Diff line change 11const jsdom = require ( 'jsdom' ) ;
2+ const dotenv = require ( 'dotenv' ) ;
23
34class CustomResourceLoader extends jsdom . ResourceLoader {
45 fetch ( url , options ) {
5- if (
6- url ===
7- 'https://mybbc-analytics.files.bbci.co.uk/reverb-client-js/reverb-3.9.2.js'
8- ) {
6+ if ( url === dotenv . config ( ) . parsed . SIMORGH_REVERB_SOURCE ) {
97 return super . fetch ( url , options ) ;
108 }
119
Original file line number Diff line number Diff line change 22import React from 'react' ;
33import IfAboveIE9 from '#app/legacy/components/IfAboveIE9Comment' ;
44import NO_JS_CLASSNAME from '#app/lib/noJs.const' ;
5- import { getProcessEnvAppVariables } from '#app/lib/utilities/getEnvConfig' ;
5+ import {
6+ getEnvConfig ,
7+ getProcessEnvAppVariables ,
8+ } from '#app/lib/utilities/getEnvConfig' ;
69import serialiseForScript from '#app/lib/utilities/serialiseForScript' ;
710import { BaseRendererProps } from './types' ;
811
@@ -49,10 +52,7 @@ export default function CanonicalRenderer({
4952 }, 5000);` ,
5053 } }
5154 />
52- < script
53- async
54- src = "https://mybbc-analytics.files.bbci.co.uk/reverb-client-js/reverb-3.9.2.js"
55- />
55+ < script async src = { `${ getEnvConfig ( ) . SIMORGH_REVERB_SOURCE } ` } />
5656
5757 { isApp && < meta name = "robots" content = "noindex" /> }
5858 { title }
You can’t perform that action at this time.
0 commit comments