Has anyone successfully kept a session active for 10 minutes while developing a chatbot using Chatkit?
Looking at the API Reference at the URL below, it seems session refresh isn’t possible. Since expires_after defaults to 10 minutes (600), I thought setting it to 1800 might extend it to 30 minutes, but sessions wouldn’t create unless set to 600 or less.
Furthermore, even if I continuously ask questions to the chatbot, the session expiration time doesn’t extend. So, even during an ongoing conversation, the session expires 10 minutes after it starts.
While I can ask questions again by recreating the session, this results in a very poor UX, so I want to keep the session active.
Has anyone successfully kept a session active for 10 minutes while developing a chatbot using Chatkit?
Looking at the API Reference at the URL below, it seems session refresh isn’t possible. Since expires_after defaults to 10 minutes (600), I thought setting it to 1800 might extend it to 30 minutes, but sessions wouldn’t create unless set to 600 or less.
Furthermore, even if I continuously ask questions to the chatbot, the session expiration time doesn’t extend. So, even during an ongoing conversation, the session expires 10 minutes after it starts.
While I can ask questions again by recreating the session, this results in a very poor UX, so I want to keep the session active.
The docs for ChatKit are very poor, but I think I’ve sorted this issue out:
You don’t need to refresh your existing session, you just need to get a new token before the time is up. When you fetch your first token, store the expires_at value. You can keep using the client_secret until the expiration. At that point, just request a new one and use it to make your next request.