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 CORS headers to CDN serving up SDK and widgets #5295

Open
danielroe opened this issue Aug 18, 2022 · 5 comments
Open

Add CORS headers to CDN serving up SDK and widgets #5295

danielroe opened this issue Aug 18, 2022 · 5 comments
Assignees
Labels
feature-request This label is used to track new features which is a significant change to existing product investigation This issues needs more work before it can be picked up for development

Comments

@danielroe
Copy link

Is your enhancement request related to a problem? Please describe.

Partytown is a mechanism for loading 3rd-party scripts in non-blocking way in a web worker. It has the capacity to dramatically improve user experience.

Describe the solution you'd like

The key thing that is required for chatwoot to work out-of-the-box with partytown is for all assets needed by the SDK (including the SDK itself) to be served up with CORS headers (ideally allowing all hosts) so that the assets can be fetched by a script rather than from the browser itself.

Describe alternatives you've considered

The only alternative to use Partytown with chatwoot would be to set up a proxy in between, but this seems to have a few issues that I can go into if adding CORS headers is not feasible.

@pranavrajs
Copy link
Member

@fayazara Please take help from @sojan-official for testing the changes. I believe we can remove the CORS * policy added to pack/js. We might need some changes or fixes in the CloudFront config. Please see the reference PR here. https://github.com/chatwoot/chatwoot/pull/1182/files

@pranavrajs pranavrajs added the investigation This issues needs more work before it can be picked up for development label Aug 18, 2022
@danielroe
Copy link
Author

I might be misunderstanding, but I think this might be less removing the CORS * policy for fonts, but rather extending it to all resources and assets.

@sojan-official
Copy link
Member

When we serve the widget directly from the Chatwoot Application, we add the Access-Control-Allow-Origin headers.

Screenshot 2022-08-18 at 7 20 55 PM

But in our cloud version, where the assets are delivered through CloudFront, we are missing these.

Screenshot 2022-08-18 at 7 20 20 PM


let have the settings updates in cloudfront

cc: @pranavrajs @fayazara @vishnu-narayanan

@productdevbook
Copy link

https://opensource.huntersofbook.com/guide/nuxt-packages/chatwoot

iam support partytown settings, but dont working. I hope you fix this soon.

@pranavrajs pranavrajs added feature-request This label is used to track new features which is a significant change to existing product and removed enhancement labels Nov 7, 2022
@fayazara fayazara removed their assignment Feb 27, 2023
@AwakenTheJaken
Copy link

AwakenTheJaken commented Jul 17, 2023

Is your enhancement request related to a problem? Please describe.

Partytown is a mechanism for loading 3rd-party scripts in non-blocking way in a web worker. It has the capacity to dramatically improve user experience.

Describe the solution you'd like

The key thing that is required for chatwoot to work out-of-the-box with partytown is for all assets needed by the SDK (including the SDK itself) to be served up with CORS headers (ideally allowing all hosts) so that the assets can be fetched by a script rather than from the browser itself.

Describe alternatives you've considered

The only alternative to use Partytown with chatwoot would be to set up a proxy in between, but this seems to have a few issues that I can go into if adding CORS headers is not feasible.

We too are having the same issue and setting the cdn host doesn't resolve my {"error":"web widget does not exist"} anyone have any more suggestions other than hosting this by downloading the JS every deploy? Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request This label is used to track new features which is a significant change to existing product investigation This issues needs more work before it can be picked up for development
Projects
Status: Engineering Backlog
Status: In Progress
Development

No branches or pull requests

7 participants