RocketChat / EmbeddedChat

An easy to use full-stack component (ReactJS) embedding Rocket.Chat into your webapp
https://www.npmjs.com/package/@embeddedchat/react
107 stars 214 forks source link

feat: configure EC remotely #599

Closed Spiral-Memory closed 5 days ago

Spiral-Memory commented 1 week ago

Brief Title

This PR adds a feature to remotely configure EmbeddedChat using the EmbeddedChat RC app.

Acceptance Criteria Fulfillment

The implementation is simple: before displaying the EmbeddedChat, we fetch the remote props from EC settings. If a new prop is present or an existing one needs to be overridden, it overrides the prop and then shows the EmbeddedChat component. These overrides happen only when remoteOpt is passed as true.

We can't directly mutate the props, so I have added a state config that now handles the props accordingly.

Fixes #597

Video/Screenshots

https://github.com/RocketChat/EmbeddedChat/assets/78961432/8f2e5027-2a8d-4723-8c2b-33ae7cbf9336

Spiral-Memory commented 5 days ago

Hey @sidmohanty11 ,

This PR is ready for review. It fixes some minor issues and mainly adds a feature to remotely configure the props. I've explained its workings in the PR description. Please take a look.

Thanks!