Skip to content

Add customVariables support to purchases-capacitor-ui#734

Merged
facumenzella merged 3 commits into
mainfrom
feat/custom-variables
Mar 19, 2026
Merged

Add customVariables support to purchases-capacitor-ui#734
facumenzella merged 3 commits into
mainfrom
feat/custom-variables

Conversation

@facumenzella

@facumenzella facumenzella commented Mar 18, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds customVariables?: Record<string, string | number | boolean> to PresentPaywallOptions for paywall text substitution ({{ custom.variable_name }} syntax)
  • Bridges custom variables through to native iOS and Android layers via existing purchases-hybrid-common support
  • Adds a CustomVariablesEditor component to the sample app (inspired by the Flutter purchase_tester) for testing variable substitution, supporting string, number, and boolean variable types

Test plan

  • Verify TypeScript types compile cleanly (npx tsc --noEmit in purchases-capacitor-ui)
  • Test presenting a paywall with custom variables on iOS
  • Test presenting a paywall with custom variables on Android
  • Test the CustomVariablesEditor in the sample app: add, edit, delete variables of all types (string, number, boolean)
  • Verify paywalls render {{ custom.* }} substitutions correctly

🤖 Generated with Claude Code

Adds the ability to pass custom variables for paywall text substitution
using the `{{ custom.variable_name }}` syntax. Implements the full bridge
across TypeScript, iOS, and Android native layers, leveraging existing
support in purchases-hybrid-common.

Also adds a CustomVariablesEditor component to the sample app (inspired
by the Flutter purchase_tester) for testing variable substitution.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@facumenzella facumenzella marked this pull request as ready for review March 19, 2026 10:08
The editor previously only supported string variables. Now uses a
two-step flow (action sheet type picker → input alert) to allow
adding and editing variables of all three types supported by the
customVariables API.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@facumenzella facumenzella requested a review from a team as a code owner March 19, 2026 10:08
@facumenzella facumenzella requested review from tonidero and vegaro March 19, 2026 10:08
@facumenzella

Copy link
Copy Markdown
Member Author

Reject empty string in parseValue for number type instead of
silently converting to 0. Also regenerate the API Extractor report
to include customVariables in PresentPaywallOptions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@facumenzella facumenzella merged commit 8d97d56 into main Mar 19, 2026
9 checks passed
@facumenzella facumenzella deleted the feat/custom-variables branch March 19, 2026 11:07
facumenzella pushed a commit that referenced this pull request Mar 19, 2026
**This is an automatic release.**

## RevenueCat SDK
### ✨ New Features
* Add platform-specific PaywallPresentationConfiguration to
purchases-capacitor-ui (#730) via Jeffrey Bunn (@Jethro87)
* Add trackCustomPaywallImpression API with offeringId override (#725)
via Rick (@rickvdl)
### 📦 Dependency Updates
* [AUTOMATIC BUMP] Updates purchases-hybrid-common to 17.52.0 (#732) via
RevenueCat Git Bot (@RCGitBot)
* [Android
9.26.1](https://github.com/RevenueCat/purchases-android/releases/tag/9.26.1)
* [Android
9.26.0](https://github.com/RevenueCat/purchases-android/releases/tag/9.26.0)
* [iOS
5.65.0](https://github.com/RevenueCat/purchases-ios/releases/tag/5.65.0)
* [iOS
5.64.0](https://github.com/RevenueCat/purchases-ios/releases/tag/5.64.0)
* Updates purchases-hybrid-common to 17.51.1 (#729) via RevenueCat Git
Bot (@RCGitBot)
* [Android
9.26.1](https://github.com/RevenueCat/purchases-android/releases/tag/9.26.1)
* [Android
9.26.0](https://github.com/RevenueCat/purchases-android/releases/tag/9.26.0)
* [iOS
5.65.0](https://github.com/RevenueCat/purchases-ios/releases/tag/5.65.0)
* [iOS
5.64.0](https://github.com/RevenueCat/purchases-ios/releases/tag/5.64.0)
* [AUTOMATIC BUMP] Updates purchases-hybrid-common to 17.49.0 (#724) via
RevenueCat Git Bot (@RCGitBot)
* [Android
9.26.1](https://github.com/RevenueCat/purchases-android/releases/tag/9.26.1)
* [Android
9.26.0](https://github.com/RevenueCat/purchases-android/releases/tag/9.26.0)
* [iOS
5.65.0](https://github.com/RevenueCat/purchases-ios/releases/tag/5.65.0)
* [iOS
5.64.0](https://github.com/RevenueCat/purchases-ios/releases/tag/5.64.0)
* [AUTOMATIC BUMP] Updates purchases-hybrid-common to 17.48.0 (#722) via
RevenueCat Git Bot (@RCGitBot)
* [Android
9.26.1](https://github.com/RevenueCat/purchases-android/releases/tag/9.26.1)
* [Android
9.26.0](https://github.com/RevenueCat/purchases-android/releases/tag/9.26.0)
* [iOS
5.65.0](https://github.com/RevenueCat/purchases-ios/releases/tag/5.65.0)
* [iOS
5.64.0](https://github.com/RevenueCat/purchases-ios/releases/tag/5.64.0)

## RevenueCatUI SDK
### Paywallv2
#### ✨ New Features
* Add customVariables support to purchases-capacitor-ui (#734) via
Facundo Menzella (@facumenzella)

### 🔄 Other Changes
* Add docs for new Paywall presentation APIs (#733) via Toni Rico
(@tonidero)
* Bump fastlane-plugin-revenuecat_internal from `3e8c384` to `9a6911b`
(#731) via dependabot[bot] (@dependabot[bot])
* Add api-extractor for public API surface tracking (#723) via Rick
(@rickvdl)
* Bump fastlane-plugin-revenuecat_internal from `e146447` to `3e8c384`
(#726) via dependabot[bot] (@dependabot[bot])
* Add Galaxy to the README (#721) via Will Taylor (@fire-at-will)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants