Hi there, when i switch the tabs around, I am losi...
# support
ç
v
To keep your entries when switching tabs, use a persistent session by storing the
sessionId
in your browser (e.g.,
localStorage
) and reusing it for all chat requests. Here’s a quick example:
Copy code
javascript
// On first load or new session
const session = await fetch('https://api.vapi.ai/session', {
  method: 'POST',
  headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' },
  body: JSON.stringify({ assistantId: 'your-assistant-id' })
}).then(res => res.json());
localStorage.setItem('sessionId', session.id);

// For all chat requests (even after tab switch)
const sessionId = localStorage.getItem('sessionId');
await fetch('https://api.vapi.ai/chat', {
  method: 'POST',
  headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' },
  body: JSON.stringify({ sessionId, input: 'Your message here' })
});
This will help you maintain context and entries across tab switches by always using the same
sessionId
in your requests. For more, see the [Session Management documentation](https://docs.vapi.ai/chat/session-management). Source: - [Session management](https://docs.vapi.ai/chat/session-management)
c
Hey, sorry to hear about the issue with your account. Could you please record a loom video showing the error or behavior you're experiencing? It would really help us understand the problem better. Also, please share your account email address so we can assist you further.
3 Views