Skip to content

feat(monetization): implement auto-upsell trigger engine (#3) - #105

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

feat(monetization): implement auto-upsell trigger engine (#3)#105
jihadMo wants to merge 1 commit into
Nexussyn:mainfrom
jihadMo:agent/jihadMo/issue-3

Conversation

@jihadMo

@jihadMo jihadMo commented Aug 19, 2026

Copy link
Copy Markdown

Closes #3

Summary of Changes:

  • Migration: Created migrations/add_upsell_triggers.sql with idempotent upsell_triggers table tracking user_id, trigger_type, shown_at, converted, and prompt_variant.
  • Engine Implementation: Implemented src/monetization/upsell.ts with UpsellEngine class evaluating call volume and returning X-Upsell-Prompt: true with contextual prompt copy on reaching 50% free threshold (5th call out of 10).
  • Idempotency: Guaranteed trigger fires strictly once per threshold crossing.
  • Tests: Added unit test suite in tests/upsell.test.ts covering threshold detection (calls 1-4 vs call 5) and duplicate suppression.

Wallet for Base USDC settlement:

0x3AD489c09A5C750b29155B0d0426Fc70654D59e5

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