Skip to content

Card trial for sign-ups from Claude, with a guaranteed way back to approve - #842

Merged
keysersoft merged 2 commits into
mainfrom
keysersoft/card-trial-in-claude-signup
Oct 3, 2026
Merged

keysersoft merged 2 commits into
mainfrom
keysersoft/card-trial-in-claude-signup

Conversation

@keysersoft

Copy link
Copy Markdown
Contributor

Follow-up to the onboarding work (#834). Today a user who signs up from "Connect" in Claude goes straight back to Approve and never sees /start-trial, so every directory sign-up lands on the no-card trial.

Flow (new admin, signing up inside the Claude authorization)

Register → verify email → /start-trial ("Either way, you go straight back to finish connecting your AI client") → Approve → (empty workspace page from #834) → back to Claude.

The pending authorization is remembered in localStorage (/auth/… paths only, 30 minutes = the backend's OAuth session), so every way out of the offer returns to the consent page:

  • Skip ("Continue without payment details" / "Try free without payment details") → back to approve.
  • Cancelled checkout: Stripe's cancel URL is /start-trial → skip → back.
  • Completed checkout: the licence site returns to /settings/license/activate#key=… → licence activated → back to approve (instead of settings). No change on the website or in Stripe.

Not offered (straight back, as before): non-admins, no running trial, an expired way back. An existing user signing in is never offered it (only right after verification).

MCP

Billing only appears when the plan's connector limit stops setup_install_connector: an admin on the free trial gets upgradeUrl: /start-trial ("nothing is charged before the trial ends"), other admins /settings/license, members "ask an administrator" with no link. No proactive upsell in tool results.

Tests

  • New e2e card-trial-claude-signup.spec.ts: offered once + skip → back; completed checkout → activate → back; cancelled checkout → skip → back; EDITOR and no-trial go straight back; expired way back ignored. Full frontend e2e: 106 passed.
  • Backend: 6624 passed (3 new plan-limit cases).
  • UI, locally against a real stack (cloud mode, local licence site, Stripe test mode with webhook forwarding): fake "Claude" OAuth client → Create an account → verify → /start-trial → Stripe Checkout opened (cs_test_…) → back without paying → skip → Approve → "Claude is connected" → client received code + state → token exchange → /mcp lists the 8 tools with the AnythingMCP Setup connector. Paying in Checkout could not be driven from the browser (no access to checkout.stripe.com); that leg is covered by the e2e test.

…prove

A new workspace admin who signs up from "Connect" in Claude is offered the
card trial once, after verifying their email and before approving the
connection. The pending authorization (kept 30 minutes by the backend) is
remembered across the detour, so every way out ends on the consent page:

- "Continue without payment details" goes straight back;
- a cancelled checkout returns to /start-trial (Stripe's cancel URL), where
  skipping goes back;
- a completed checkout returns to /settings/license/activate, which
  activates the licence and goes back instead of opening settings.

Members, workspaces without a running trial and an expired way back skip
the offer. Through MCP, billing is mentioned only when the plan's connector
limit stops an install: an admin on the free trial gets the card-trial page,
other admins the licence page, members who to ask.
@keysersoft
keysersoft enabled auto-merge (squash) October 3, 2026 13:10
@keysersoft
keysersoft merged commit 541db14 into main Oct 3, 2026
13 checks passed
@keysersoft
keysersoft deleted the keysersoft/card-trial-in-claude-signup branch October 3, 2026 13:13
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant