Cueflow.shutdown()
Remove all messages and clean up Cueflow. Call this when the user logs out or when you need to reset.
Syntax
Cueflow.shutdown()Parameters
None.
Basic Example
// Clean up Cueflow
Cueflow.shutdown();When to Use
User Logout
Always call shutdown() when a user logs out:
async function handleLogout() {
await api.logout();
// Clean up Cueflow
Cueflow.shutdown();
// Redirect to login
window.location.href = '/login';
}Switching Users
When switching between users (e.g., account impersonation):
Component Unmount
In React/Vue when the component unmounts:
Testing/Development
Reset state during development or testing:
What Happens
When you call shutdown():
Removes all messages - Banners, modals, checklists, etc. are removed from DOM
Removes styles - Cueflow CSS is removed
Stops navigation listener - No longer listens for page changes
Resets internal state - User data and contact ID cleared
After shutdown(), you can call init() again with a new user.
Framework Examples
React with Auth
Next.js App Router
Vue with Vuex
Safe to Call Anytime
shutdown() is safe to call even if:
Cueflow wasn't initialized
Already shut down
No messages are displayed
Complete User Session Flow
Next Steps
Cueflow.init() - Re-initialize after shutdown
Overview - Full embed script reference
Last updated