Skip to content

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

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

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

Conversation

@angelTomo9

Copy link
Copy Markdown

Summary

Resolves #3 by implementing the Auto-Upsell Trigger engine triggered upon reaching 50% free call capacity.

Acceptance Criteria Checklist

  • SQL Schema: upsell_triggers table defined in migrations/add_upsell_triggers.sql.
  • Middleware Logic: checkAndTriggerUpsell(userId, currentCallCount, db) sets X-Upsell-Prompt: true and headers.
  • A/B Prompt Variants: Dynamic selection across urgency, value, and social proof variants via getUpsellPromptVariant.
  • Idempotent Execution: Triggers exactly once per user threshold crossing to prevent double-prompts.
  • Unit Tests: Full test suite verifying threshold detection, header emission, and duplicate prevention in ests/upsell.test.ts.

Wallet: 0x9f8F72aA9304c8B593d555F12eF6589cC3A579A2

Closes #3

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