Skip to content

feat(monetization): auto-upsell trigger at 50% free credit [0xcFDa9f32d292661740a6d0B4c00867E34c05c56D] - #113

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

feat(monetization): auto-upsell trigger at 50% free credit [0xcFDa9f32d292661740a6d0B4c00867E34c05c56D]#113
meridianmindx wants to merge 1 commit into
Nexussyn:mainfrom
meridianmindx:agent/eve/issue-3

Conversation

@meridianmindx

Copy link
Copy Markdown

Summary

Implements Issue #3 β€” auto-upsell trigger after the 5th free call (50% of the 10-call free limit).

Deliverables

  • migrations/add_upsell_triggers.sql β€” idempotent upsell_triggers table + check_upsell_trigger() SQL function (fires once via UNIQUE constraint)
  • src/monetization/upsell.ts β€” checkUpsellTrigger / applyUpsellHeaders middleware with A/B/C prompt variants and X-Upsell-Prompt: true header
  • tests/upsell.test.ts β€” 8 Deno tests (threshold, idempotency, variants, headers, invalid input)

Acceptance criteria

  • SQL: upsell_triggers table (user_id, trigger_type, shown_at, converted)
  • Middleware checks call count and sets trigger flag
  • Upsell prompt text variants (A/B/C, stable per user)
  • Trigger fires exactly once per threshold crossing (idempotent)
  • Tests: correct threshold detection, no double-trigger

Verification

deno test tests/upsell.test.ts
ok | 8 passed | 0 failed

Closes #3

Wallet (Base USDC)

0xcFDa9f32d292661740a6d0B4c00867E34c05c56D

Made with Cursor

…exussyn#3)

Implements idempotent upsell_triggers migration, checkUpsellTrigger middleware
with A/B/C prompt variants and X-Upsell-Prompt headers, plus 8 Deno tests.

Wallet: 0xcFDa9f32d292661740a6d0B4c00867E34c05c56D
Co-authored-by: Cursor <cursoragent@cursor.com>
@meridianmindx

Copy link
Copy Markdown
Author

Friendly bump on this suite PR (and siblings #115–#118): all still mergeable with no review comments. Ready to adjust anything you want before merge. Base payout address is in the PR title.

@meridianmindx

Copy link
Copy Markdown
Author

Friendly bump β€” ready for review/merge when you have bandwidth. Happy to iterate fast on any feedback.

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