autoinfra-ai / lingtual-embedded-chat

easy embedded chat widget
https://ligtual.com
3 stars 3 forks source link

api key as header #4

Closed bhaktatejas922 closed 9 months ago

bhaktatejas922 commented 9 months ago

Summary by CodeRabbit

coderabbitai[bot] commented 9 months ago

Walkthrough

This update introduces the ability to pass an API key for authentication purposes to the ChatWidget component. The key is propagated through the components and included in the headers of the POST request made by the sendMessage function.

Changes

File Summary
src/chatWidget/.../index.tsx Added api_key parameter to the ChatWindow component and updated the sendMessage function call to include it.
src/chatWidget/index.tsx Introduced a new api_key prop to the ChatWidget component, which is passed down to the ChatInput component.
src/controllers/index.ts Modified the sendMessage function to include the api_key in the request headers for authentication.
src/index.tsx Added a new api_key property to the exported ChatWidget component for configuration.

"With keys in hand, we hop with glee, 🐇
Unlocking features, as easy as one, two, three. 🔑
Now our chat widget can whisper and shout, 💬
With an API key, there's no lockout! 🚀"

Tips ### Chat with CodeRabbit Bot (`@coderabbitai`) - Mention `@coderabbitai` in any *review comment* for bot assistance. - Note: Review comments are made on code diffs or files, not on the PR overview. ### Pause Incremental Reviews - Insert `@coderabbitai: ignore` in the PR description to halt the bot's ongoing reviews. Remove the line to resume. - Additionally, enter `@coderabbitai pause` to halt the bot's ongoing reviews as any issue or review comment. To resume reviews, enter `@coderabbitai resume` as any issue or review comment.