Skip to content

Session Lifecycle

Create one createBrowserLifecycle() instance per browser tab and drive it through explicit phases:

ts
const lifecycle = createBrowserLifecycle({ autoStart: false });
lifecycle.start();
// ...
lifecycle.stop();
lifecycle.dispose();

Creating a new session on every render or route change without disposing the previous instance.

Trade-offs

autoStart: true is convenient for demos. autoStart: false gives tighter control when registering plugins first.

Playground

Inspect phase transitions in the Lifecycle Playground.

An ecosystem of independent, headless TypeScript libraries engineered for modern web development. Every package includes interactive playgrounds and documentation that evolves alongside the code.