Repository navigation
Conversation
|
@danestves is attempting to deploy a commit to the Better T Stack Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2996c62c14
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughAdds RevenueCat as a new payments provider option restricted to native (Expo) frontends. Changes include PaymentsSchema enum and dependency versions, CLI prompts and compatibility validation, web UI option constants, test matrix cases and oracle rules, template processor routing and env var generation, Convex backend templates, native layout provider wrapping, RevenueCat SDK utility and context/provider layers, native UI components, UI template integration, post-install instructions, and regenerated template bundle with new RevenueCat templates. ChangesRevenueCat Payments Integration
Possibly Related PRs
Pre-merge checks:
|
There was a problem hiding this comment.
Actionable comments posted: 7
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 2c80508a-7553-4c93-b637-93bdd1a566aa
📒 Files selected for processing (27)
apps/cli/src/prompts/payments.tsapps/cli/src/utils/compatibility-rules.tsapps/cli/test/matrix/cases.tsapps/cli/test/matrix/oracle.tsapps/web/src/app/(home)/new/_components/utils.tsapps/web/src/lib/constant.tspackages/template-generator/src/processors/env-vars.tspackages/template-generator/src/processors/payments-deps.tspackages/template-generator/src/template-handlers/payments.tspackages/template-generator/src/templates.generated.tspackages/template-generator/src/utils/add-deps.tspackages/template-generator/templates/auth/better-auth/convex/backend/convex/http.ts.hbspackages/template-generator/templates/backend/convex/packages/backend/convex/convex.config.ts.hbspackages/template-generator/templates/frontend/native/bare/app/_layout.tsx.hbspackages/template-generator/templates/frontend/native/unistyles/app/_layout.tsx.hbspackages/template-generator/templates/frontend/native/uniwind/app/_layout.tsx.hbspackages/template-generator/templates/payments/revenuecat/convex/backend/convex/revenuecat.ts.hbspackages/template-generator/templates/payments/revenuecat/convex/no-better-auth/convex/http.ts.hbspackages/template-generator/templates/payments/revenuecat/native/bare/components/paywall-example.tsx.hbspackages/template-generator/templates/payments/revenuecat/native/bare/components/subscription-status-card.tsx.hbspackages/template-generator/templates/payments/revenuecat/native/base/lib/revenue-cat/index.ts.hbspackages/template-generator/templates/payments/revenuecat/native/base/providers/RevenueCatProvider.tsx.hbspackages/template-generator/templates/payments/revenuecat/native/unistyles/components/paywall-example.tsx.hbspackages/template-generator/templates/payments/revenuecat/native/unistyles/components/subscription-status-card.tsx.hbspackages/template-generator/templates/payments/revenuecat/native/uniwind/components/paywall-example.tsx.hbspackages/template-generator/templates/payments/revenuecat/native/uniwind/components/subscription-status-card.tsx.hbspackages/types/src/schemas.ts
| { | ||
| id: "revenuecat", | ||
| name: "RevenueCat", | ||
| description: "In-app subscriptions and cross-platform monetization for mobile.", | ||
| icon: `${ICON_BASE_URL}/revenuecat.svg`, | ||
| color: "from-red-400 to-red-600", | ||
| default: false, | ||
| }, |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
URL="https://r2.better-t-stack.dev/icons/revenuecat.svg"
echo "Checking: $URL"
curl -sS -o /dev/null -w "HTTP %{http_code}\n" -I "$URL"Repository: AmanVarshney01/create-better-t-stack
Length of output: 150
Upload RevenueCat icon asset to R2 before shipping.
The icon asset at https://r2.better-t-stack.dev/icons/revenuecat.svg is missing (HTTP 404). This will render a broken icon in the payments picker UI. Upload the asset to complete this feature.
There was a problem hiding this comment.
Acknowledged — revenuecat.svg needs uploading to the R2 icon bucket, which is a maintainer step (I can't push to that bucket). It's called out in the PR description, and the entry follows the existing polar.svg convention, so it resolves once the asset is added.
There was a problem hiding this comment.
@danestves, understood — thanks for the context. Since the R2 upload is a maintainer step and already documented in the PR description, the implementation-side work is complete. The concern stays open only until the asset is actually uploaded.
Would you like me to open a GitHub issue to track the R2 asset upload (revenuecat.svg → r2.better-t-stack.dev/icons/) so it doesn't get missed after this PR merges?
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 9b6d331d-cc49-4b71-95ca-672ca632bf6b
📒 Files selected for processing (14)
apps/cli/src/helpers/addons/mcp-setup.tsapps/cli/src/helpers/core/post-installation.tspackages/template-generator/src/templates.generated.tspackages/template-generator/templates/auth/better-auth/native/bare/app/(drawer)/index.tsx.hbspackages/template-generator/templates/auth/better-auth/native/unistyles/app/(drawer)/index.tsx.hbspackages/template-generator/templates/auth/better-auth/native/uniwind/app/(drawer)/index.tsx.hbspackages/template-generator/templates/frontend/native/bare/app/(drawer)/index.tsx.hbspackages/template-generator/templates/frontend/native/unistyles/app/(drawer)/index.tsx.hbspackages/template-generator/templates/frontend/native/uniwind/app/(drawer)/index.tsx.hbspackages/template-generator/templates/payments/revenuecat/native/bare/components/paywall-example.tsx.hbspackages/template-generator/templates/payments/revenuecat/native/bare/components/subscription-status-card.tsx.hbspackages/template-generator/templates/payments/revenuecat/native/uniwind/components/paywall-example.tsx.hbspackages/template-generator/templates/payments/revenuecat/native/uniwind/components/subscription-status-card.tsx.hbspackages/types/src/schemas.ts
🚧 Files skipped from review as they are similar to previous changes (3)
- packages/template-generator/templates/payments/revenuecat/native/uniwind/components/subscription-status-card.tsx.hbs
- packages/template-generator/templates/payments/revenuecat/native/bare/components/paywall-example.tsx.hbs
- packages/template-generator/src/templates.generated.ts
Adds `revenuecat` as a payments provider for in-app purchases on native (Expo / React Native) apps. Unlike Polar, RevenueCat is native-gated and auth-agnostic: it is offered only when a native frontend is selected, and works with any backend except `none`. - Schema/prompt/validation: `revenuecat` added to `PaymentsSchema`; `validatePaymentsCompatibility` rejects it without a native frontend. Matrix oracle and cases cover the new rule. - Convex backend wires the `convex-revenuecat` component: `app.use(revenuecat)` in `convex.config.ts`, a `POST /webhooks/revenuecat` route via `registerRoutes`, and a `revenuecat.ts` client exposing `hasEntitlement` / `isSubscriber` / `getActiveSubscriptions`. Other backends get the SDK integration only. - Native scaffolding for all three variants: an auth-agnostic `RevenueCatProvider` plus a `lib/revenuecat` SDK layer, with `subscription-status-card` and `paywall-example` components built in each variant's own UI kit and mounted on the drawer home screen. - Env: native `.env` gets `EXPO_PUBLIC_REVENUECAT_IOS_KEY` / `_ANDROID_KEY` / `_ENTITLEMENT_ID`; Convex `.env.local` gets `REVENUECAT_WEBHOOK_AUTH`. - Post-install instructions and the RevenueCat MCP server are surfaced when the provider is selected. - Web stack-builder gains RevenueCat with a native-frontend constraint. Native code is based on 0rtbo/convexpo-revenuecat, adapted to this project's conventions; the reference's `user-context` coupling and identity auto-sync were dropped to keep the provider auth-agnostic.
d36b138 to
4e33148
Compare
e53495c to
c842ad8
Compare
# Conflicts: # apps/cli/test/generated-builds.test.ts # apps/cli/test/matrix/cases.ts # apps/cli/test/matrix/oracle.ts # apps/web/test/stack-builder-compatibility.test.ts # packages/template-generator/src/processors/varlock.ts # packages/template-generator/src/utils/add-deps.ts
- identify the signed-in Better Auth or Clerk user with Purchases.logIn through a RevenueCatUserBridge, so Convex entitlement queries match; only export those queries when there is an auth provider - read native env through ENV, use the documented cancellation error code, configure once at startup and show why setup failed (Expo Go, web) - move the provider to components/, drop unused SDK helpers and the undeclared offering env var - generic Convex payments http router, Axiom-style optional key comment, no hard-coded native list in deps, Polar-style web validation gate - setup instructions generate the webhook secret and explain dev builds - docs, skills, CLI label and live-test filters list RevenueCat - replace the dropped matrix tests with generated-build samples and a compatibility contract test
|
Thanks for this! I merged current
Verified locally:
Still open:
|
What
Adds RevenueCat as a
paymentsprovider for in-app purchases on native (Expo / React Native) apps.Polar covers web subscriptions through Better-Auth. There is currently no option for mobile in-app purchases, which is a different billing model: the stores own the transaction, and subscription state lives outside your backend. RevenueCat fills that gap.
Unlike Polar, RevenueCat is native-gated and auth-agnostic:
native-bare/native-uniwind/native-unistyles) is selected, with any backend exceptnone.convex-revenuecatcomponent:app.use(revenuecat)inconvex.config.ts, a webhook viaregisterRoutes(POST /webhooks/revenuecat), and arevenuecat.tsclient exposinghasEntitlement/isSubscriber/getActiveSubscriptions.react-native-purchasesSDK integration only, since RevenueCat hosts subscription state.How it works
revenuecatadded toPaymentsSchema. The prompt offers it when a native frontend is present, andvalidatePaymentsCompatibilityerrors if it is selected without one. Matrix oracle and cases updated withpayments-revenuecat-requires-native-frontend.http.tswhen present, and a standalonehttp.tsis generated for Convex + Clerk/none so the Better-Auth routes are never clobbered.RevenueCatProviderplus alib/revenuecatSDK layer, withsubscription-status-cardandpaywall-examplecomponents written in each variant's own UI kit (StyleSheet / heroui-native / unistyles) and mounted on the drawer home screen. The provider is mounted via a conditional wrap in eachapp/_layout.tsx..envgetsEXPO_PUBLIC_REVENUECAT_IOS_KEY/_ANDROID_KEY/_ENTITLEMENT_ID. Convex.env.localgetsREVENUECAT_WEBHOOK_AUTHwith setup comments.apps/webwith a native-frontend constraint, mirroring how Polar gates on Better-Auth.Native code is based on
0rtbo/convexpo-revenuecat, adapted to this project's conventions. The reference'suser-contextcoupling and identity auto-sync were dropped to keep the provider auth-agnostic, and the example components are SDK/provider-based rather than tied to a specific Convexsubscriptionsmodule.Main sync
Merged
mainatdfeba394(3.45.0), preserving the contributor's feature commit. Resolved the deleted stack-builder utility and moved the RevenueCat frontend constraint into the current shared compatibility API, CLI prompt/validation, and web builder. Regenerated the embedded templates from the merged source.RevenueCat's platform SDK keys are optional in the app-owned Varlock schema, matching the SDK wrapper's platform-specific key selection and missing-key state. This lets the generated app build before billing is configured and avoids requiring the other platform's key. The listener uses the SDK's exported
CustomerInfoUpdateListenerand callsremoveCustomerInfoUpdateListenerdirectly.Verification
bun run checkandbun run build:cli: passed.BTS_MATRIX_MODE=smoke: 1135 passed, 65 skipped, 0 failed, including the compatibility matrix. Generated build samples are opt-in and run separately below._generatedfiles.Metro exports produce JavaScript bundles; native compilation/signing, simulator purchase flows, real store purchases, and live Convex webhook delivery were not verified.
Remaining items
The existing RevenueCat icon URL (
https://r2.better-t-stack.dev/icons/revenuecat.svg) still returns 404. Its review thread remains unresolved pending the asset upload or an agreed replacement.Vercel reports "Authorization required to deploy." for the fork preview. GitHub test/build checks have restarted for the updated head.
Dependency ranges remain
convex-revenuecat: ^0.3.2andreact-native-purchases: ^10.9.0; this sync does not change their release lines.Official references checked: Varlock schema decorators, RevenueCat listener lifecycle, and the published SDK/component declarations and source.
Native code is based on 0rtbo/convexpo-revenuecat, adapted to this project's conventions, as described above.