@@ -57,7 +57,15 @@ export class FileBasedConfiguration extends DatadogProviderConfiguration {
5757 ...rest
5858 } = jsonConfiguration ;
5959
60- // TODO: Handle undefined clientToken, env or trackingConsent
60+ if (
61+ clientToken === undefined ||
62+ env === undefined ||
63+ trackingConsent === undefined
64+ ) {
65+ console . warn (
66+ 'DATADOG: Warning - Malformed json configuration file - `clientToken`, `env` and `trackingConsent` are mandatory Core SDK properties.'
67+ ) ;
68+ }
6169
6270 // Configure Core SDK
6371 const coreConfiguration = removeUndefinedEntries ( rest ) ;
@@ -86,7 +94,7 @@ export class FileBasedConfiguration extends DatadogProviderConfiguration {
8694 params ?. actionEventMapper ?? RUM_DEFAULTS . actionEventMapper ;
8795 } else {
8896 console . warn (
89- 'DATADOG: Warning - Malformed RUM File Configuration - `applicationId` is undefined'
97+ 'DATADOG: Warning - Malformed RUM File Configuration - `applicationId` is undefined. '
9098 ) ;
9199 this . rumConfiguration = undefined ;
92100 }
@@ -132,17 +140,6 @@ export const getJSONConfiguration = (
132140) : JsonConfiguration => {
133141 const configuration = resolveJSONConfiguration ( userSpecifiedConfiguration ) ;
134142
135- if (
136- configuration . clientToken === undefined ||
137- configuration . env === undefined ||
138- ( configuration . rumConfiguration !== undefined &&
139- configuration . rumConfiguration . applicationId === undefined )
140- ) {
141- console . warn (
142- 'DATADOG: Warning: Malformed json configuration file - clientToken and env are mandatory Core SDK properties. ApplicationId is mandatory to enable RUM.'
143- ) ;
144- }
145-
146143 return {
147144 additionalConfiguration : configuration . additionalConfiguration ,
148145 clientToken : configuration . clientToken ,
0 commit comments