mydnic / laravel-feedback-component

Customizable Feedback Component for Laravel
MIT License
274 stars 25 forks source link

Feature request: standalone widget #5

Closed cord closed 5 years ago

cord commented 5 years ago

Would be great to integrate the widget in any site using some javascript widget

mydnic commented 5 years ago

Yes I think it could be done! Will need to move all configuration from php to javascript, I will have to tink around this when working on V2 with the Chat Feature

mydnic commented 5 years ago

I'm having some troubles figuring this out, the main problem is: To include a configuration file, it would need to be compiled by the end user. So he can change the configuration, and rebuild the final javascript file of Kustomer with the included config.

That could be okay, but it adds a step to "get started", and it requires the end user to have laravel-mix setup in their laravel application. If they don't, it would be very annoying to setup all this just to add a plugin.

Another way is to keep the configuration in PHP file that would be accessible from a HTTP API Call. But that could be easily changed by malicious users, and it adds complexity in the package.

I think what's best is:

  1. Insert a line in to the javascript file of Kustomer
  2. At the end of the body, insert a single blade include to a partials provided by the package.

I'll close this issue and go with this solution