cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

window.dtrum is always undefined using dtrum.d.ts

christiansolano
Newcomer

Hi,

I trying to use the dtrum API. However, it is not working even after configuring the Dynatrace folder on the typeRoots section under the compilerOptions of the tsconfig.json.

Any idea how to solve this issue?

1 REPLY 1

Matthias____
Dynatrace Promoter
Dynatrace Promoter

Hi,

Firstly, it’s important to note that the dtrum.d.ts file is only a types file and does not contain any actual logic. This means that simply configuring the Dynatrace folder in the typeRoots section under compilerOptions of your tsconfig.json won’t make the API work on its own.

To ensure the dtrum API functions correctly, you should validate that the RUM JavaScript snippet is running properly in your environment. This is crucial as this snippet is responsible for the actual implementation of the dtrum API.

Additionally, for a robust implementation, it’s a good practice to treat the dtrum API as optional in your JavaScript code. This way, your application can gracefully handle scenarios where the API might not be available.

More related documentation: https://docs.dynatrace.com/docs/platform-modules/digital-experience/web-applications/additional-conf... 

I hope this helps!

Featured Posts