## Summary - Closes [#75](#75) - Companion for [chat_backend#34](ai_ml_operations/chat_backend#34) (self-delete API) - Account Billing: Upgrade / Change plan / Cancel CTAs (Stripe portal–first), plan picker when multiple public selectable plans exist, cancel confirmation with period-end messaging, complimentary users get no fake cancel - Usage card Upgrade scrolls/focuses Billing; analytics for upgrade/change/cancel intents - Danger Zone: email-confirmed `DELETE /user/` then logout → `/signin/` ## Test plan - [ ] `npm test -- --watchAll=false --testPathPattern='BillingSection|DeleteAccountSection'` - [ ] Paid Stripe user: Upgrade / Change plan / Cancel → portal (or checkout for higher selectable plan) - [ ] Cancel confirm shows period-end access copy; scheduled cancel notice when `cancel_at_period_end` - [ ] Backer/admin: complimentary message, no Cancel/Upgrade - [ ] Delete account: confirm email → soft-delete → signed out at `/signin/`Reviewed-on: #76
## Summary Closes #36. Helpers / consent gating already exist from [#42](#42). This PR adds **call sites** + docs: - `identifyAccount` + `AnalyticsSession` (identify on session; `Logout` when auth ends) - Auth: Sign In / Sign Up / AuthCallback (SSO) success & fail - Billing: Checkout started, Payment Success / Canceled - Chat: Conversation Created, Message Sent (metadata only — no prompt text) - ToS Acknowledged - `BILLING_PORTAL_OPENED` reserved until Account portal (#33) - Catalog: [`llm-fe/ANALYTICS.md`](llm-fe/ANALYTICS.md) No `chat_backend` changes required. ## Test plan - [ ] Grant consent on beta → sign in → Tianji shows Login Success + identify - [ ] Decline consent → same actions produce no custom events (page views still ok) - [ ] Sign up + checkout + cancel/success return URLs fire expected events - [ ] New chat + send message → Conversation Created / Message Sent without prompt text - [ ] Acknowledge ToS → ToS Acknowledged - [ ] `npm run test:ci -- --testPathPattern='analytics.test|SignIn.test|SignUp.test|AuthCallback.test'`Reviewed-on: #45
## Summary Closes #35. - **Flip deploy workflows** (mirror `dta_webapp`): push/merge to `master` → auto-deploy **beta**; **Deploy Prod** is `workflow_dispatch` only - **Tianji**: `REACT_APP_TIANJI_WEBSITE_ID` + `REACT_APP_DEPLOY_ENV` in `.env.production` / `.env.beta`; Tracker loads page views always on prod/beta - **Consent policy**: page views always live; custom events / identify gated via `analyticsConsent` + `AnalyticsConsentBanner` + `trackEvent`/`identifyUser` helpers (call sites remain #36) - Remove invalid Tianji `<script>` from `index.tsx` (Tracker component owns injection) - README documents beta auto / prod button + Tianji policy ## Ops note — beta Tianji website ID Prod ID unchanged: `cm7x7m52m03kbddswbswrt17y`. `.env.beta` has `REACT_APP_TIANJI_WEBSITE_ID=` empty until a **Hesychia Beta** website is created in Tianji (workspace `cm7w8087y020lddswyhamadj2`). Paste the new id into `.env.beta` before beta page views show under a distinct site. ## Test plan - [x] `npm run test:ci` (106 tests) - [ ] Create Hesychia Beta Tianji website; set `REACT_APP_TIANJI_WEBSITE_ID` in `.env.beta` - [ ] Merge to master → Deploy Beta runs; prod does **not** auto-deploy - [ ] Manual Run workflow on Deploy Prod still works - [ ] Beta build hits `beta.chatbackend` REST/WS; static root `/var/www/beta.chat.aimloperations/html` (8083) - [ ] Prod/beta: tracker.js loads without accepting consent; banner shows until Accept/Decline; `trackEvent` only fires after AcceptReviewed-on: #42