Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update some init parameters after init #2618

Open
bdwain opened this issue Feb 20, 2024 · 2 comments
Open

Update some init parameters after init #2618

bdwain opened this issue Feb 20, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@bdwain
Copy link

bdwain commented Feb 20, 2024

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

@bdwain bdwain added the enhancement New feature or request label Feb 20, 2024
@amortemousque
Copy link
Contributor

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.

@bdwain
Copy link
Author

bdwain commented Feb 23, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants