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

Add ability to disable integrations/plugins CDN #1938

Open
adrianlyjak opened this issue Nov 21, 2024 · 8 comments
Open

Add ability to disable integrations/plugins CDN #1938

adrianlyjak opened this issue Nov 21, 2024 · 8 comments
Assignees
Labels
open source PRs or issues originating from the open-source community

Comments

@adrianlyjak
Copy link

adrianlyjak commented Nov 21, 2024

I'm confused why the new v3 javascript sdk is reaching out to a CDN to load various plugins and integrations. I would like the full script to be embedded in the NPM package that I already loaded.

I understand that I could self host these, but that seems rather extreme. Would prefer to just have the loaded in my existing bundler.

I tried upgrading to v3, and am now running into rudderstack no longer working in Firefox with enhanced-track-protection, since, unsurprisingly, it marks these rudderlabs CDN urls as tracking urls.

image

@adrianlyjak adrianlyjak added the open source PRs or issues originating from the open-source community label Nov 21, 2024
@contributor-support
Copy link

Thanks for opening this issue! We'll get back to you shortly. If it is a bug, please make sure to add steps to reproduce the issue.

@saikumarrs
Copy link
Member

Hi @adrianlyjak
Thanks for reaching out.

In the v3 version, we've refactored the non-essential functionalities of the SDK into plugins that can be hot-loaded based on the config and browser capabilities.
The integrations will not be part of the SDK bundle as far too many of them exist.

If you use the NPM package, you can use a different export that bundles core and all the plugins together, @rudderstack/analytics-js/bundled. Just so you know, the final bundle size will increase due to the presence of plugins.

You can set up custom proxies if you have connected any device mode destinations to your source.

Please let us know if you need any help.

@adrianlyjak
Copy link
Author

@saikumarrs ok, thanks, I'll try that, and see what the bundle size is there, or I might self host the integrations

@saikumarrs saikumarrs self-assigned this Nov 21, 2024
@adrianlyjak
Copy link
Author

adrianlyjak commented Nov 21, 2024

@saikumarrs follow up question: is there any way to entirely disable the integrations--and is there any documentation clarifying what the integrations are? I'm mainly interested in sending to the rudderstack destination and having the heavy logic routing logic sit there, and keeping the client light.

@adrianlyjak
Copy link
Author

For reference, I tried these options, but still see the SDK making requests to the CDN:

{
  loadIntegration: false,
  plugins: []
}

@saikumarrs
Copy link
Member

Hi @adrianlyjak
For your use case, you can disconnect the device mode destinations from your JavaScript source. If you want to temporarily avoid loading destinations on the client side, you can configure it in the load API options.

rudderanalytics.load(writeKey, dpUrl, {
  integrations: {
    All: false
  }
});

Please refer to https://www.rudderstack.com/docs/sources/event-streams/sdks/rudderstack-javascript-sdk/filtering/#filter-destinations-while-loading-sdk for more details.

@saikumarrs saikumarrs reopened this Nov 22, 2024
@adrianlyjak
Copy link
Author

Ah, ok, I thought that would prevent events from being sent. With that option set, I still see the client trying to load rsa-plugins from the CDN (without importing from /bundled)

@saikumarrs
Copy link
Member

Hi @adrianlyjak
Plugins and integrations are separate components. With the above load option, you can only let the SDK know to avoid loading any integrations.

If you don't want to load any plugins, set the plugins load API option to an empty array. Please note that you'll lose multiple useful features as a result.
I'd recommend you import the bundled export from the package, if your sole intention is to avoid additional resource requests from the SDK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
open source PRs or issues originating from the open-source community
Projects
None yet
Development

No branches or pull requests

2 participants