From ee6ed161d5d33d4f3a11a4dadf75cec1342cd5fa Mon Sep 17 00:00:00 2001 From: dcs-soni <52232900+dcs-soni@users.noreply.github.com> Date: Fri, 10 Oct 2025 09:56:27 +0530 Subject: [PATCH] docs: fixes in authentication code --- packages/docs/src/content/docs/guides/authentication.mdx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/docs/src/content/docs/guides/authentication.mdx b/packages/docs/src/content/docs/guides/authentication.mdx index c5478ae..4a5a3b1 100644 --- a/packages/docs/src/content/docs/guides/authentication.mdx +++ b/packages/docs/src/content/docs/guides/authentication.mdx @@ -28,7 +28,7 @@ To keep sessions alive, refresh the token just before its expiration and reconne ```jsx const { control } = useChatKit({ api: { - getClientSecret(currentClientSecret) { + async getClientSecret(currentClientSecret) { if (!currentClientSecret) { const res = await fetch('/api/chatkit/start', { method: 'POST' }) const {client_secret} = await res.json(); @@ -36,7 +36,7 @@ To keep sessions alive, refresh the token just before its expiration and reconne } const res = await fetch('/api/chatkit/refresh', { method: 'POST', - body: JSON.stringify({ currentClientSecret }) + body: JSON.stringify({ currentClientSecret }), headers: { 'Content-Type': 'application/json', }, @@ -57,7 +57,7 @@ To keep sessions alive, refresh the token just before its expiration and reconne chatkit.setOptions({ api: { - getClientSecret(currentClientSecret) { + async getClientSecret(currentClientSecret) { if (!currentClientSecret) { const res = await fetch('/api/chatkit/start', { method: 'POST' }) const {client_secret} = await res.json(); @@ -65,7 +65,7 @@ To keep sessions alive, refresh the token just before its expiration and reconne } const res = await fetch('/api/chatkit/refresh', { method: 'POST', - body: JSON.stringify({ currentClientSecret }) + body: JSON.stringify({ currentClientSecret }), headers: { 'Content-Type': 'application/json', },