Installation
Add the snippet to your root HTML file (public/index.html for Create React App, or the equivalent entry HTML for Vite).
public/index.html
Calling identify
Callidentify() inside a useEffect that runs when the authenticated user is available. The snippet’s queue system means this is safe to call before or after the script loads.
src/components/ZenstepProvider.tsx
src/main.tsx
TypeScript types
Add a global type declaration so TypeScript knows aboutwindow.zenstep:
src/global.d.ts
SPA navigation
Zenstep automatically detects client-side navigation using a History APIpushState observer. When the URL changes, it re-evaluates all targeting rules and shows any newly-matching flows.
No additional setup is required.