Skip to content

feat(app): Omi Pro free-trial paywall right after sign-up as the trial arm of the paywall experiment - #22237

Merged
kodjima33 merged 9 commits into
mainfrom
kodjima33/trial-paywall
Oct 18, 2026
Merged

kodjima33 merged 9 commits into
mainfrom
kodjima33/trial-paywall

Conversation

@kodjima33

@kodjima33 kodjima33 commented Oct 18, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

New trial arm of the mobile paywall experiment (paywall-variant, PostHog 957521): a native free-trial paywall shown once right after sign-up and consent, before the first onboarding step.

  • TrialPaywallPage: feature carousel (5 cards), dated timeline (today / +7 days free / charge on day 7; no reminder row, since nothing delivers one yet), the Unlimited feature list, month/year cards, "Start for $0.00", "Continue with the free plan". Light canvas on purpose: it sits between the light onboarding steps. Prices come from the catalog.

  • Checkout is the shared Stripe Checkout path (PaywallCheckout.start), now with trialDays: 7.

  • Backend: POST /v1/payments/checkout-session accepts trial_days (1–30) and passes subscription_data.trial_period_days to Stripe. A reader who already has a Stripe customer (a former subscriber back on the free plan) is refused with 400 trial_unavailable rather than charged at once. GET /v1/users/me/subscription reports trial_eligible (free plan and no Stripe customer) so the client never shows the trial copy to someone who cannot get it. Older clients send no trial_days and behave exactly as before.

  • Eligibility gate in the app: PaywallRouter only opens the trial page when subscription.trialEligible is true (otherwise the opener keeps the shipped sheet, exposure still recorded for the arm); the after-sign-up placement awaits the subscription first; the page refuses to start a checkout when not eligible.

  • Placement: OnboardingWrapper._enterSteps shows the page once for the trial arm with onboarding_paywall: true; the end-of-onboarding placement skips that arm.

  • Analytics: Paywall Variant Shown.variant gains trial (registry regenerated).

  • PostHog: variant trial added at 0% with payload {"onboarding_paywall": true}; the two existing Nik-only targeting groups now resolve to trial. Everyone else stays on control.

  • 31 l10n keys (paywallTrial*) with translations for every locale. The plan is named Omi Pro on this screen (backend tier id stays unlimited); renaming the plan everywhere else in the app is a follow-up.

  • Slide art is designed at 280pt and scaled down to the card (FittedBox), so 320/360pt phones and three-line captions never overflow; trial_paywall_page_test.dart pumps every slide at 320, 360 and 430pt and asserts no overflow, plus the plan cards and yearly saving.

  • Carries the one-line OnDeviceParakeet MARKETING_VERSION fix from fix(ios): give the OnDeviceParakeet framework a MARKETING_VERSION so TestFlight uploads succeed again #22239 so the branch build can reach TestFlight; it merges cleanly once fix(ios): give the OnDeviceParakeet framework a MARKETING_VERSION so TestFlight uploads succeed again #22239 lands.

  • The page runs one operation at a time (Restore/dismiss are no-ops during an in-flight checkout; completions after a dismissal or an external pop never navigate), and a trial checkout confirms "Your 7-day free trial of Omi Pro has started" instead of the paid-checkout "charged" toast. Navigation regressions in trial_paywall_navigation_test.dart.

Testing

  • flutter analyze, flutter test test/unit/paywall_experiment_test.dart test/widgets/paywall_router_test.dart.
  • iOS simulator, dev flavor with --dart-define=OMI_PAYWALL_VARIANT=trial --dart-define=OMI_ONBOARDING_RERUN=1, signed in as [email protected] (plan basic): the page opens right after consent, swipe through the carousel, month/year toggle, "Continue with the free plan" returns to the Name step. Screenshots (iPhone 16 Pro simulator):

After sign-up placement
Carousel card 2
Plans
Dismiss returns to the Name step

  • Backend unit tests test_payment_checkout_trial.py: first-time subscriber gets trial_period_days: 7; former subscriber gets 400 trial_unavailable; no trial_days keeps the old checkout.
  • Router widget tests: eligible reader sees TrialPaywallPage; former subscriber keeps the sheet. Both also exercised at runtime on the simulator through the VM service (eligibility toggled on the provider, PaywallRouter.openVariant → page / no page).

Line-Count-Exception: backend/routers/payment.py | 1784 -> 1793 | optional trial_days on the checkout request plus the first-time-subscriber refusal; splitting the router is out of scope here
Line-Count-Exception: backend/database/users.py | 2494 -> 2497 | get_stripe_customer_id reads through the shared request-scoped user projection
Line-Count-Exception: backend/routers/users.py | 2670 -> 2679 | trial_eligible computed next to the other subscription-response flags, failing closed on a lookup error

Failure-Class: none

Not in this PR

  • Superwall: not used. Its Stripe web checkout grants entitlements through Superwall's own deep link, not through our Stripe webhook keyed by metadata.uid, so a subscriber paid without the backend unlocking them. Our existing Stripe Checkout path already avoids the App Store fee.
  • The backend change must be on prod before the flag's trial split goes above 0%, otherwise the screen promises a trial the checkout does not give.

🤖 Generated with Claude Code

@mintlify

mintlify Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
omi 🟢 Ready View Preview Oct 18, 2026, 10:16 PM

💡 Tip: Enable Automations to automatically generate PRs for you.

kodjima33 and others added 3 commits October 18, 2026 15:04
… the paywall experiment

A native free-trial paywall (feature carousel, dated timeline, month/year, Start for $0.00)
shown once after sign-up and consent for readers in the new trial arm of paywall-variant.
Checkout is the shared Stripe Checkout path with trial_days: 7; the backend honors it only
for a first-time subscriber. Older clients send no trial_days and behave as before.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…App Store Connect accepts the build

Since #21488 every TestFlight upload fails with ITMS-90057: OnDeviceParakeet.framework's generated
Info.plist has no CFBundleShortVersionString because the framework target set no MARKETING_VERSION.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
(cherry picked from commit a8426b6)
kodjima33 and others added 6 commits October 18, 2026 15:34
…jection for trial eligibility

One user-document read per request, deduplicated with the subscription/BYOK read when
request_read_dedupe is on; eligibility fails closed if the lookup errors.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…reminder is actually delivered

Nothing handles customer.subscription.trial_will_end yet, so the timeline must not promise one.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…tions after dismissal

Restore and dismissal are no-ops while a checkout (or restore) is in flight, and a checkout that
settles after the page was dismissed never pops again. Navigation regression tests added.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…l pops

A trial checkout now confirms the free trial started instead of "you've been charged"; a page popped
from outside is marked dismissed immediately so a checkout settling during the exit animation never
pops the host route. Regression test added.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@kodjima33
kodjima33 merged commit 357e06c into main Oct 18, 2026
76 of 79 checks passed
@kodjima33
kodjima33 deleted the kodjima33/trial-paywall branch October 18, 2026 23:22
kodjima33 added a commit that referenced this pull request Oct 21, 2026
… trial paywall sees eligibility (#22493)

## Summary

Follow-up to #22237, found by exercising the real path on prod:
`UsageProvider.fetchSubscription()` returned immediately when a fetch
was already in flight (AppShell starts one on mount), so
`OnboardingWrapper._maybeShowSignupPaywall` read a null subscription
right after sign-in and the trial placement never opened. Concurrent
callers now share and await the in-flight request.

## Testing (prod, api.omi.me, test account [email protected] /
basic plan, no Stripe customer)

- Sign in → hot restart → the trial paywall opens from the real
`trial_eligible` (no injected state):
![After sign-up on
prod](https://raw.githubusercontent.com/BasedHardware/omi/73cb742196e73961008b480459aef93614b2b9d0/.agent-artifacts/ui-evidence/trial-paywall/001-mobile-ios-trial-paywall-after-signup.png)
- "Start for $0.00" → live Stripe Checkout: **7 days free, then $269.91
per year starting Oct 26, 2026**; Stripe session `amount_total: 0`,
`client_reference_id` = the test uid:
![Stripe
Checkout](https://raw.githubusercontent.com/BasedHardware/omi/73cb742196e73961008b480459aef93614b2b9d0/.agent-artifacts/ui-evidence/trial-paywall/005-mobile-ios-trial-paywall-stripe-checkout.png)
- Back from Checkout keeps the paywall; tapping again opens a fresh $0
session (retry works); "Continue with the free plan" lands on the Name
step.
- Former-subscriber state (a `stripe_customer_id` set on the test
account, then removed): `/v1/users/me/subscription` returns
`trial_eligible: false` and `POST /v1/payments/checkout-session` with
`trial_days: 7` is refused with HTTP 400.
- Widget tests: paywall router, navigation, layout, checkout hand-off,
cancel-pending suites all pass (33).

Failure-Class: none

🤖 Generated with [Claude Code](https://claude.com/claude-code)


<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/22493?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="View guided diff"
src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a>
<a
href="https://www.cubic.dev/action/auto-fix/pr/BasedHardware/omi/22493?returnTo=https%3A%2F%2Fgithub.com%2FBasedHardware%2Fomi%2Fpull%2F22493&source=description"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"><img
alt="Turn on auto-fix"
src="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->
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.

1 participant