--- title: "Userflow in Angular and micro-frontend (shell) apps: setup and timing" slug: "using-userflow-in-angular-and-shell-micro-frontend-applications" description: "Learn how to integrate Userflow in Angular SPAs with shell or micro-frontend architecture, ensuring smooth user flows and effective identity management." tags: ["Userflow Integration", "Angular Applications", "Micro-Frontend Architecture"] updated: 2026-10-26T16:17:00Z published: 2026-10-26T16:17:00Z canonical: "help.userflow.com/using-userflow-in-angular-and-shell-micro-frontend-applications" --- > ## Documentation Index > Fetch the complete documentation index at: https://help.userflow.com/llms.txt > Use this file to discover all available pages before exploring further. # Userflow in Angular and micro-frontend (shell) apps: setup and timing Userflow works in Angular single-page apps, including apps that use lazy loading and client-side routing, and in shell (micro-frontend) setups. Load Userflow.js once in the shell, identify the user there, and start flows only after Angular has rendered the page they point at. ## Is Userflow supported in Angular and micro-frontend apps? Yes. Userflow supports Angular single-page apps, including lazy loading and client-side routing. A shell or micro-frontend setup works as long as Userflow.js loads in the shell and can see the content the micro-frontends render. Userflow doesn't integrate with Angular directly. Userflow.js is a JavaScript snippet that runs in the host app, so it works with any framework. ## Set up Userflow in an Angular shell app To set up Userflow in an Angular shell or micro-frontend app: 1. Load Userflow.js in the shell app, so it's present for every micro-frontend for the whole session. See [Userflow.js Installation](https://help.userflow.com/docs/userflowjs-installation). 2. Call `identify()` once per session in the shell, for example after sign-in or when user data becomes available. 3. Initialize Userflow.js early enough that flows can run on any route, but start flows only after Angular has finished rendering the view they point at. Here's how that plays out in a typical session: - The shell loads and initializes Userflow.js. - The user signs in, and the shell calls `identify()` with the user's ID and attributes. - The user moves between Angular routes and micro-frontends. Userflow.js stays loaded in the shell and can show flows on any route. ## Start flows after Angular has rendered the page In Angular and micro-frontend apps, a flow has to start after the route and its components have rendered, so the elements the flow points at exist on the page. You may need to start flows from Angular lifecycle hooks or router events, for example after navigation ends and the view has initialized. ## Test lazy-loaded routes and elements that change If your Angular app uses lazy-loaded modules, dynamic components, or several micro-frontends, test the routes where content appears late or changes often. Check that the elements your flows point at (buttons, links, form fields) are on the page and stable when the flow runs. ## Identify users in the shell only In a micro-frontend app, call `identify()` in the shell only, not separately in each micro-frontend. One place for identity keeps sessions consistent and makes sure analytics and targeting all use the same user. ## Known limitations in Angular and micro-frontend apps Nothing specific to Angular or shell setups blocks Userflow.js. Most problems in these apps come from two things: - Flows trying to attach to elements that haven't rendered yet, or that change often. - Identity handled in several places instead of once in the shell. Shell setups vary a lot, so run a short proof of concept in a staging environment first. Test your key routes, flows, and page elements to confirm that targeting, triggers, and step positions work as expected. ## Related articles - [Userflow.js Installation](https://help.userflow.com/docs/userflowjs-installation) - [Userflow.js installation check](https://help.userflow.com/docs/userflowjs-installation-check) - [Content Security Policy: domains to allow for Userflow.js](https://help.userflow.com/docs/content-security-policy) ## Related - [Userflow.js installation check](/userflowjs-installation-check.md)