feat(paywalls): add web_view SDK variables provider (PWENG-98)#3663
Open
alexrepty wants to merge 1 commit into
Open
Conversation
This was referenced Jun 26, 2026
Contributor
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
This was referenced Jun 26, 2026
276280e to
7769f56
Compare
8558b7d to
2790f47
Compare
7769f56 to
716657f
Compare
1387950 to
ffd8f08
Compare
716657f to
27bcaa4
Compare
ffd8f08 to
b70692b
Compare
27bcaa4 to
c009f2d
Compare
b70692b to
c8ba63e
Compare
c009f2d to
3ca2b9e
Compare
9c03cae to
c73e87b
Compare
5525f6c to
d7f8fa1
Compare
c73e87b to
cf8f802
Compare
Adds a bidirectional JS<->native bridge for the Paywalls V2 `web_view` component: a document-start `window.RevenueCatWebView` shim, message parsing/validation (`WebViewMessageParser`, `WebViewMessageType`), the public `PaywallWebViewMessage` / `PaywallWebViewValue` / `PaywallWebViewMessageHandler` / `PaywallWebViewController` surface, and an SDK-managed variables provider (locale, color scheme, custom variables). Apps opt in via `PaywallOptions.setWebViewMessageHandler(...)`, threaded through `PaywallState` / `OfferingToStateMapper`. Regenerates ui/revenuecatui/api.txt for the new public API. Recommended labels: pr:feat, pr:RevenueCatUI, feat:Paywalls_V2
cf8f802 to
f341b57
Compare
d7f8fa1 to
86b7b79
Compare
📸 Snapshot Test2 modified, 591 unchanged
🛸 Powered by Emerge Tools |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Checklist
purchases-iosand hybridsMotivation
When web content sends
rc:request-variables, the SDK replies with safe, already-available system context. v1 exposes onlylocale; the paywall's dashboard-defined custom variables are intentionally not passed across the bridge.Part of PWENG-98.
Description
PaywallWebViewVariablesProvider: builds the SDK-managed variables payload ({ locale }only) andsanitizeAppProvidedVariables, which strips reserved top-level keys so app-provided values cannot overwrite SDK-managed ones (they nest undercustom).PaywallWebViewVariablesProviderTest.iOS parity: mirrors
purchases-ios(web-view-bridge-wiring), which likewise exposeslocaleonly and treats custom variables as out of scope for v1.Stack (merge bottom-up): schema → rendering → CSP → value types → message model → variables provider → JS bridge → wiring.
Note
Low Risk
New internal helper and unit tests only; no public API or bridge wiring yet, with deliberate limits on what crosses the web view boundary.
Overview
Adds internal
PaywallWebViewVariablesProviderso the upcoming JS bridge can answerrc:request-variableswith a v1-safe payload: SDK-managedlocaleonly (no dashboard custom vars, keys, or PII).sdkManagedVariables(locale)returns{ "locale": … }asPaywallWebViewValuemap;sanitizeAppProvidedVariablesstrips reserved top-level keys (today justlocale) and logs when apps try to overwrite them—aligned with app vars living undercustomviaPaywallWebViewController.postVariables.PaywallWebViewVariablesProviderTestcovers locale-only SDK map and reserved-key stripping. Wiring into the bridge is a follow-up PR in the stack.Reviewed by Cursor Bugbot for commit f341b57. Bugbot is set up for automated code reviews on this repo. Configure here.