Install with the CLI
Vite
1
Environment variable
.env:2
Provider component
src/providers.tsx:3
Wrap the render call
src/main.tsx:Create React App
1
Environment variable
.env:2
Provider component
src/providers.tsx:3
Wrap the render call
src/index.tsx:Notes
- Env var prefixes differ: Vite uses
VITE_, CRA usesREACT_APP_. The CLI picks the right one for you. - The provider wraps the render call in the entrypoint, not inside
App.tsx. This keeps it outside ofReact.StrictMode’s double‑mount behavior so the session isn’t reset on the development reload.