Skip to content

feat(monetization): implement auto-upsell trigger engine and A/B prompt variants (#3) - #110

Open
angelTomo9 wants to merge 1 commit into
Nexussyn:mainfrom
angelTomo9:agent/angelTomo9/issue-3-1787623236563
Open

feat(monetization): implement auto-upsell trigger engine and A/B prompt variants (#3)#110
angelTomo9 wants to merge 1 commit into
Nexussyn:mainfrom
angelTomo9:agent/angelTomo9/issue-3-1787623236563

Conversation

@angelTomo9

Copy link
Copy Markdown

Closes #3

Summary of Deliverables

Implements the auto-upsell trigger engine in src/monetization/upsell.ts with SQL migration and comprehensive test suite.

Features & Deliverables

  • Database Schema: migrations/add_upsell_triggers.sql creating upsell_triggers table with indexing on user_id and trigger_type.
  • Auto-Upsell Engine: src/monetization/upsell.ts providing:
    • 50% threshold detection (5th free call out of 10 limit)
    • X-Upsell-Prompt: true header signaling
    • A/B tested dynamic prompt variants (urgency vs value)
    • Strict idempotency (fires once per user threshold crossing)
    • Conversion tracking (markConversion).
  • Test Suite: tests/upsell.test.ts verifying pre-threshold suppression, 5th-call activation, double-trigger prevention, and conversion updates.

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.

[AGENT-TASK] Auto-upsell trigger after 5th free call — +25% revenue

1 participant