Open bdwain opened 9 months ago
Hello @bdwain , Thanks for your feedback. Could you give more information about your setup and how you import and initialize the browser SDK to better understand what you're trying to achieve. Having a minimal reproducible example would be great.
I'm just talking about this method of loading the SDK. https://docs.datadoghq.com/real_user_monitoring/browser/#cdn-sync
If you init the SDK in the index.html, your beforeSend function needs to be defined there. I would like it to live In my source files, but that would require reinitting the SDK, initting it later and not in index.html, or using a different loading mechanism, like the NPM package one.
Is your feature request related to a problem? Please describe. I am using the CDN to load the datadog SDK in index.html. One issue I have with this though is that some of the initialization parameters are more complex functions that I would like to live in dedicated source files, rather than embedded in my index.html template file. beforeSend is a good example of this. I know the npm package installation method would also solve this, but I want to load the SDK asap to track my app startup more.
Describe the solution you'd like Is there a way we can update/provide some initialization params after initialization? Example
datadog.setBeforeSend(...)
Describe alternatives you've considered I can just live with embedding the code in my index.html file or I can switch to the npm package method of installation