From f3ba5568a311dc64a9b2a37ec0ad1987ee4b4e9f Mon Sep 17 00:00:00 2001 From: OMGATE23 Date: Thu, 10 Apr 2025 18:41:56 +0530 Subject: [PATCH] feat: handle `withCredentials` handling --- src/components/hooks/useVideoDBAgent.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/hooks/useVideoDBAgent.js b/src/components/hooks/useVideoDBAgent.js index ded89ac..3cfe936 100644 --- a/src/components/hooks/useVideoDBAgent.js +++ b/src/components/hooks/useVideoDBAgent.js @@ -20,9 +20,11 @@ const fetchData = async (rootUrl, endpoint) => { }; export function useVideoDBAgent(config) { - const { debug = false, socketUrl, httpUrl } = config; + const { debug = false, socketUrl, httpUrl, withCredentials } = config; if (debug) console.log("debug :videodb-chat config", config); - const socket = io(socketUrl); + const socket = io(socketUrl, { + withCredentials: typeof withCredentials === "boolean" ? withCredentials : true, + }); const session = reactive({ isConnected: false,