Skip to content

Remove manual lifecycle and billing SDK events#160

Merged
leo-paz merged 3 commits into
mainfrom
codex/remove-authoritative-lifecycle-billing
Jul 15, 2026
Merged

Remove manual lifecycle and billing SDK events#160
leo-paz merged 3 commits into
mainfrom
codex/remove-authoritative-lifecycle-billing

Conversation

@leo-paz

@leo-paz leo-paz commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • remove authoritative user lifecycle and customer billing commands from the browser, React, Vue, script, Node, and Rust SDK surfaces
  • remove StageEvent and BillingEvent from shared ingest types and OpenAPI; retain ordinary identify and track events
  • update SDK docs, READMEs, examples, tests, and changesets to explain that Core derives activation/engagement/inactivity and verified integrations provide billing status

Verification

  • bun run lint
  • bun run typecheck
  • bun run build
  • browser unit tests: 54 passed
  • browser public API surface E2E: 1 passed
  • core tests: 47 passed
  • node tests: 5 passed
  • cargo fmt --all -- --check
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo test --all-features: 52 passed
  • changeset validation and status checks

Note

A local full browser run passed 132 tests and timed out only in the live external Cal.com booking test. GitHub CI remains the authoritative full-browser gate and includes retries.

Summary by CodeRabbit

  • Breaking Changes
    • Removed manual lifecycle and billing APIs and related event types across browser, Node.js, and Rust SDKs.
    • Browser/Node hook and client namespaces now expose only identify for user identity and track() for product activity.
    • Activation, engagement, inactivity, and billing status are derived from ordinary events and verified integrations.
  • Documentation
    • Updated Quick Starts, activation guidance, and server API/reference docs to match the event-driven workflow.
  • Tests
    • Removed stage/billing-specific suites and expanded coverage for flushing/shutdown and the streamlined client API surface.

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 54c6ce82-52c4-4c9c-b43e-80f40f241c49

📥 Commits

Reviewing files that changed from the base of the PR and between e288181 and 7e3380a.

📒 Files selected for processing (4)
  • docs/tracking/browser/react.mdx
  • examples/pi-agents/tests/activation-pretriage.test.ts
  • packages/browser/__tests__/e2e/browser-sdk.spec.ts
  • packages/browser/__tests__/e2e/fixtures/test-page-queued.html
💤 Files with no reviewable changes (1)
  • docs/tracking/browser/react.mdx
🚧 Files skipped from review as they are similar to previous changes (3)
  • packages/browser/tests/e2e/browser-sdk.spec.ts
  • packages/browser/tests/e2e/fixtures/test-page-queued.html
  • examples/pi-agents/tests/activation-pretriage.test.ts

Walkthrough

The SDKs remove manual lifecycle and billing APIs, builders, payload types, and public namespaces. Activation is documented and exemplified through ordinary track() events, while engagement, inactivity, and billing are derived from activity or verified integrations.

Changes

Lifecycle and billing API removal

Layer / File(s) Summary
Core and Rust event contracts
packages/core/src/*, crates/outlit/src/*, crates/outlit/tests/*
Stage and billing event contracts, builders, validators, exports, and Rust namespaces are removed; remaining flush and serialization behavior is tested.
Browser API and queue surface
packages/browser/src/*, packages/browser/__tests__/*
Browser, script, React, and Vue APIs expose identify and tracking while removing lifecycle methods, billing namespaces, and related queue fixtures/tests.
Node client and activation pretriage
packages/node/src/*, packages/node/README.md, examples/pi-agents/*
The Node client retains identity/tracking APIs, while activation pretriage uses Core-derived stages and ordinary product activity without activation-event counts.
Documentation and release contract
README.md, docs/*, crates/outlit/README.md, crates/outlit/CHANGELOG.md, .changeset/*
Examples and guidance use ordinary activation/product events, describe verified billing integrations, and document the breaking API removal.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

Suggested reviewers: rafa-thayto

Poem

Hoppity hops, the stages fade,
Track little milestones newly made.
Identity stays, billing’s verified,
Old rabbit trails are retired.
Core now reads the event stream bright—
A cleaner API takes flight!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: removing manual lifecycle and billing SDK events.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/remove-authoritative-lifecycle-billing

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (2)
examples/pi-agents/tests/activation-pretriage.test.ts (1)

93-94: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Retain positive assertions for the remaining activity contract.

These checks prove only that removed identifiers are absent. They would still pass if the query accidentally stopped selecting recentEventCount or recentActiveDays. Keep the negative assertions, but also assert the retained SQL aliases or the normalized baseline values.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@examples/pi-agents/tests/activation-pretriage.test.ts` around lines 93 - 94,
Add positive assertions to the activation-pretriage test alongside the existing
negative checks, verifying that the query still selects the retained activity
contract, such as recentEventCount and recentActiveDays aliases or their
normalized baseline values. Preserve the current absence assertions for
stage:activated and activationEventCount.
packages/browser/src/vue/composables.ts (1)

137-139: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

user.identify silently no-ops when uninitialized, unlike sibling methods.

track, identify, setUser, and clearUser all console.warn and return early when outlit.value is falsy. user.identify instead uses optional chaining and silently swallows the call, which can hide misuse (calling before init) from consumers.

♻️ Suggested fix
     user: {
-      identify: (options: BrowserIdentifyOptions) => outlit.value?.user.identify(options),
+      identify: (options: BrowserIdentifyOptions) => {
+        if (!outlit.value) {
+          console.warn("[Outlit] Not initialized.")
+          return
+        }
+        outlit.value.user.identify(options)
+      },
     },
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/browser/src/vue/composables.ts` around lines 137 - 139, Update
user.identify in the composable to match the initialization guard used by track,
identify, setUser, and clearUser: warn and return early when outlit.value is
falsy, otherwise invoke outlit.value.user.identify(options) without optional
chaining.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/tracking/browser/react.mdx`:
- Around line 451-452: Move the track('onboarding_completed', { flow:
'onboarding' }) call out of the React render example and into the successful
milestone handler, following the pattern shown around Lines 559-567. Ensure it
emits only when the onboarding milestone succeeds, not on rerenders.

In `@packages/browser/__tests__/e2e/browser-sdk.spec.ts`:
- Line 585: Strengthen the assertion in the browser SDK test by inspecting the
identify event payload and matching the unique email or user ID provided by the
queued fixture, rather than only checking event.type. Keep the assertion focused
on confirming replay of the queued user.identify call.

---

Nitpick comments:
In `@examples/pi-agents/tests/activation-pretriage.test.ts`:
- Around line 93-94: Add positive assertions to the activation-pretriage test
alongside the existing negative checks, verifying that the query still selects
the retained activity contract, such as recentEventCount and recentActiveDays
aliases or their normalized baseline values. Preserve the current absence
assertions for stage:activated and activationEventCount.

In `@packages/browser/src/vue/composables.ts`:
- Around line 137-139: Update user.identify in the composable to match the
initialization guard used by track, identify, setUser, and clearUser: warn and
return early when outlit.value is falsy, otherwise invoke
outlit.value.user.identify(options) without optional chaining.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 488b7375-02cc-4c4d-a887-f1c3b6974b5a

📥 Commits

Reviewing files that changed from the base of the PR and between ee68785 and e288181.

📒 Files selected for processing (79)
  • .changeset/remove-authoritative-lifecycle-billing.md
  • README.md
  • crates/outlit/CHANGELOG.md
  • crates/outlit/README.md
  • crates/outlit/src/builders.rs
  • crates/outlit/src/client.rs
  • crates/outlit/src/lib.rs
  • crates/outlit/src/types.rs
  • crates/outlit/tests/integration.rs
  • crates/outlit/tests/payload_compatibility.rs
  • docs/api-reference/ingest.mdx
  • docs/api-reference/introduction.mdx
  • docs/concepts/customer-context-graph.mdx
  • docs/concepts/customer-journey.mdx
  • docs/openapi.json
  • docs/tracking/browser/angular.mdx
  • docs/tracking/browser/astro.mdx
  • docs/tracking/browser/npm.mdx
  • docs/tracking/browser/nuxt.mdx
  • docs/tracking/browser/react.mdx
  • docs/tracking/browser/script.mdx
  • docs/tracking/browser/sveltekit.mdx
  • docs/tracking/browser/vue.mdx
  • docs/tracking/how-it-works.mdx
  • docs/tracking/server/nodejs.mdx
  • docs/tracking/server/rust.mdx
  • examples/pi-agents/README.md
  • examples/pi-agents/lib/activation-pretriage-data.ts
  • examples/pi-agents/lib/activation-pretriage.ts
  • examples/pi-agents/skills/outlit-growth-agents/SKILL.md
  • examples/pi-agents/tests/activation-pretriage.test.ts
  • examples/pi-agents/tests/pretriage-utils.test.ts
  • packages/browser/README.md
  • packages/browser/__tests__/e2e/api-surface.spec.ts
  • packages/browser/__tests__/e2e/browser-sdk.spec.ts
  • packages/browser/__tests__/e2e/fixtures/form-all-sensitive.html
  • packages/browser/__tests__/e2e/fixtures/form-auto-identify-disabled.html
  • packages/browser/__tests__/e2e/fixtures/form-credit-card.html
  • packages/browser/__tests__/e2e/fixtures/form-email-first-last.html
  • packages/browser/__tests__/e2e/fixtures/form-email-name.html
  • packages/browser/__tests__/e2e/fixtures/form-email-no-name.html
  • packages/browser/__tests__/e2e/fixtures/form-email-only.html
  • packages/browser/__tests__/e2e/fixtures/form-file-inputs.html
  • packages/browser/__tests__/e2e/fixtures/form-multiple.html
  • packages/browser/__tests__/e2e/fixtures/form-no-email.html
  • packages/browser/__tests__/e2e/fixtures/form-no-id.html
  • packages/browser/__tests__/e2e/fixtures/form-password-variations.html
  • packages/browser/__tests__/e2e/fixtures/form-ssn.html
  • packages/browser/__tests__/e2e/fixtures/test-page-consent-persistence.html
  • packages/browser/__tests__/e2e/fixtures/test-page-consent.html
  • packages/browser/__tests__/e2e/fixtures/test-page-custom-denylist.html
  • packages/browser/__tests__/e2e/fixtures/test-page-links.html
  • packages/browser/__tests__/e2e/fixtures/test-page-no-forms.html
  • packages/browser/__tests__/e2e/fixtures/test-page-no-pageviews.html
  • packages/browser/__tests__/e2e/fixtures/test-page-queued.html
  • packages/browser/__tests__/e2e/fixtures/test-page-session.html
  • packages/browser/__tests__/e2e/fixtures/test-page-timer.html
  • packages/browser/__tests__/e2e/fixtures/test-page.html
  • packages/browser/__tests__/e2e/global.d.ts
  • packages/browser/__tests__/e2e/stage-methods.spec.ts
  • packages/browser/__tests__/unit/react-hooks.test.tsx
  • packages/browser/__tests__/unit/tracker.test.ts
  • packages/browser/__tests__/unit/vue-composables.test.ts
  • packages/browser/src/index.ts
  • packages/browser/src/react/hooks.ts
  • packages/browser/src/react/index.ts
  • packages/browser/src/script.ts
  • packages/browser/src/tracker.ts
  • packages/browser/src/vue/composables.ts
  • packages/core/src/__tests__/customer-identity.test.ts
  • packages/core/src/__tests__/types.test.ts
  • packages/core/src/index.ts
  • packages/core/src/payload.ts
  • packages/core/src/types.ts
  • packages/core/src/utils.ts
  • packages/node/README.md
  • packages/node/src/__tests__/client.test.ts
  • packages/node/src/client.ts
  • packages/node/src/index.ts
💤 Files with no reviewable changes (9)
  • packages/browser/tests/e2e/stage-methods.spec.ts
  • packages/browser/tests/unit/tracker.test.ts
  • packages/core/src/utils.ts
  • packages/browser/tests/e2e/global.d.ts
  • docs/openapi.json
  • packages/core/src/index.ts
  • crates/outlit/tests/integration.rs
  • crates/outlit/src/types.rs
  • packages/core/src/payload.ts

Comment thread docs/tracking/browser/react.mdx Outdated
Comment thread packages/browser/__tests__/e2e/browser-sdk.spec.ts Outdated
@leo-paz
leo-paz merged commit 7f5ee85 into main Jul 15, 2026
5 checks passed
This was referenced Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant