-
Notifications
You must be signed in to change notification settings - Fork 17
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
Setting configureSession results in a broken Chatbot #243
Comments
Hello, could you try like below with const configureSession = useCallback(
(): SessionHandler => ({
onSessionTokenRequired: (resolve, reject) => {
console.log("SessionHandler.onSessionTokenRequired()");
issueSessionToken(userEmail ?? "")
.then((token) => resolve(token))
.catch((error) => reject(error));
},
onSessionRefreshed: () => {
console.log("SessionHandler.onSessionRefreshed()");
},
onSessionError: (error) => console.log(error),
onSessionClosed: () => console.log("SessionHandler.onSessionClosed()"),
}),
[issueSessionToken, userEmail]
); We perform instance checks within the SDK, but currently, the widget does not use the SDK as a peer dependency, so instance checks were not working with the same module. To address this, we have refactored it to allow usage in object form as well. |
@bang9 thanks for the update, however using the latest |
Oh.. It seems there is a timing issue during the token renewal process while connecting in the Chat SDK. |
Hi @mobiware I'm currently awaiting PR review. sendbird/sendbird-uikit-react#1107 |
## Changes - [UIKit] merge `main` into `ai-widget/experimental` branch and update HEAD. - Do not reuse the cached session if the user ID has been changed in manual strategy. ticket: [AC-2476] resolve: #243 [AC-2476]: https://sendbird.atlassian.net/browse/AC-2476?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
I'm trying to use
configureSession
on<ChatAiWidget />
but I can't get it to work.I've followed the step-by-step guide in the documentation but when I set the
configureSession
prop on<ChatAiWidget />
, the chatbot window gets empty and transparent (see screenshot below).No console logs are seen even though all session callbacks are issuing logs.
See component code below
NOTE: this is only a POC, we are aware that we should not directly use the
Api-Token
client side. In the production version the session token will be issued from our backend.The text was updated successfully, but these errors were encountered: