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():

  1. Removes all messages - Banners, modals, checklists, etc. are removed from DOM

  2. Removes styles - Cueflow CSS is removed

  3. Stops navigation listener - No longer listens for page changes

  4. 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

Last updated