- Stops session replay and flushes any remaining events
- Stops automatic page view tracking
- Stops error and console interceptors
- Removes the chat bubble, iframe, and injected CSS from the DOM
- Clears the widget JWT
destroy(), you can call init() again to re-initialize with a new configuration.
Example: reinitialize with different config
When to use
- User logout — use
Hacktionbase.logout()instead if you just want to clear identity without removing the widget - SPA route cleanup — if you only want the widget on certain pages, use
hide()/show()instead - Full teardown — use
destroy()when the SDK should be completely removed (e.g., switching tenants in a white-label app)

