@superwall/cli 2.6.0 → 2.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{apple-D-rfsuDA.js → apple-BE1GBJFP.js} +14 -14
- package/dist/{approve-aPc5RoXB.js → approve-yRZmvkCj.js} +6 -6
- package/dist/{assets-PyuXe45Y.js → assets-DTAgbWw0.js} +3 -3
- package/dist/auth.js +3 -3
- package/dist/{base-CAU0hWoI.js → base-zc1wl_9b.js} +2 -2
- package/dist/{billing-Dt6L_l9R.js → billing-C1LV4-BN.js} +3 -3
- package/dist/{build-CY5FnMNY.js → build-CQd-pf7O.js} +8 -8
- package/dist/{config-DOp5oChe.js → config-DCqRQTJ4.js} +3 -3
- package/dist/create-CSHGZDfB.js +18 -0
- package/dist/{create-D6w3UL0m.js → create-Costu6UT.js} +7 -7
- package/dist/{create-BZL5VH4L.js → create-wlCp83IH.js} +25 -25
- package/dist/{doctor-C9FR0qw3.js → doctor-Bd9ffg51.js} +19 -19
- package/dist/entry.js +24 -24
- package/dist/{environment-sE2wZYdg.js → environment-Dn7irhZr.js} +1 -1
- package/dist/{existing--peXpOZj.js → existing-BQMB_2AG.js} +8 -8
- package/dist/{held-CUBCOCGP.js → held-D5wSX2Mf.js} +8 -8
- package/dist/held-Dmf5SR3p.js +15 -0
- package/dist/{install-C5d82gZF.js → install-CxyqfKFe.js} +10 -10
- package/dist/{integrate-D8J_X1bj.js → integrate-MkyDDzI5.js} +19 -19
- package/dist/{login-DXhm9L0F.js → login-B7IqDafm.js} +1 -1
- package/dist/{login-C6X7JrhM.js → login-BMHDhxAx.js} +6 -6
- package/dist/login-Cp0-BgDZ.js +13 -0
- package/dist/{lookup-DqmIbUkv.js → lookup-DkcT4E-5.js} +3 -3
- package/dist/{migrate-BYF6hKZ2.js → migrate-CdFoZipj.js} +26 -26
- package/dist/{notification-url-Bo54nkXv.js → notification-url-D6KKeXnk.js} +2 -2
- package/dist/{open-xdgXUzaF.js → open-COJE6ryI.js} +2 -2
- package/dist/{org-BD8U3D1_.js → org-BV8wwxwc.js} +3 -3
- package/dist/{organization-D-ZlB3qU.js → organization-9R_1PJKk.js} +3 -3
- package/dist/{orgs-DQQJ3sw_.js → orgs-ltP8H0Nl.js} +1 -1
- package/dist/{paths-CIlyzF2I.js → paths-Cb1RfjaX.js} +1 -1
- package/dist/{playbook-ecggWGFi.js → playbook-CVGolez9.js} +9 -9
- package/dist/{promote-QVMLGYlU.js → promote-B_HnFEbX.js} +19 -19
- package/dist/{pull-CCXhb2a7.js → pull-DF4KYVcP.js} +7 -7
- package/dist/pull-JxiMyRwY.js +30 -0
- package/dist/{pull-CrdsfsAl.js → pull-lYRULo4v.js} +24 -24
- package/dist/push-B5py7h5y.js +29 -0
- package/dist/{push-DJMGG7zW.js → push-BZN1Qpkq.js} +7 -7
- package/dist/{push-DiMDwGfe.js → push-BnllH2Rd.js} +4 -4
- package/dist/{push-D6pJM_vv.js → push-DHlUMkbf.js} +11 -11
- package/dist/registry-BGEYCWyD.js +22 -0
- package/dist/{registry-BSnQXft4.js → registry-CqePfigB.js} +51 -51
- package/dist/{resolve-DO7bPota.js → resolve-B4bd3Qjl.js} +2 -2
- package/dist/{resources-XwvXA20E.js → resources-BaURbSpY.js} +2 -2
- package/dist/{run-B-YvxfRc.js → run-Bme4Egyl.js} +9 -9
- package/dist/{scan-ViBhmrB7.js → scan-DugxddUU.js} +1 -1
- package/dist/scan-J2DILUNE.js +4 -0
- package/dist/{scope-BLLUxbrA.js → scope-DDYLQeZw.js} +6 -6
- package/dist/{selection-C07e_GGY.js → selection-C439nEhn.js} +1 -1
- package/dist/{server-CBtHzl9y.js → server-C_aMxzvS.js} +9 -9
- package/dist/server-Cif9w5lM.js +33 -0
- package/dist/{session-BlrwAdGN.js → session-B7frlXXQ.js} +1 -1
- package/dist/{session-BfVx50iA.js → session-CfG3gzko.js} +5 -5
- package/dist/session-DvaPyOuH.js +5 -0
- package/dist/{setup-a4B72xJ8.js → setup-DQEasPhx.js} +9 -9
- package/dist/skills/index.json +5 -0
- package/dist/skills/superwall-framework/SKILL.md +52 -23
- package/dist/skills/superwall-framework/references/layout.md +30 -2
- package/dist/skills/teleport/SKILL.md +154 -0
- package/dist/skills/teleport/references/experiments.md +328 -0
- package/dist/skills/teleport/references/setup.md +157 -0
- package/dist/{skills-BB1uIt8t.js → skills-DnegE1A6.js} +4 -4
- package/dist/{skills-SnxFa2in.js → skills-MmF7IyTg.js} +7 -7
- package/dist/{source-push-w7miTr6m.js → source-push-MbJjh4Ki.js} +4 -4
- package/dist/{spinner-BQp7fQvK.js → spinner-Dcr-Dqdi.js} +4 -4
- package/dist/{status-DxsIw9zq.js → status-DHRxg1ZA.js} +6 -6
- package/dist/{storage-BR6imSqm.js → storage-DdIAHolY.js} +1 -1
- package/dist/{storekit-BqyujKQ_.js → storekit-De998QOt.js} +4 -4
- package/dist/storekit-iBCWmeKn.js +15 -0
- package/dist/{theme-Ed0gz6hr.js → theme-BrUrye-c.js} +4 -4
- package/dist/{token-CWQ6tdva.js → token-CKCBQ4I8.js} +1 -1
- package/dist/tools-skills/teleport/SKILL.md +154 -0
- package/dist/tools-skills/teleport/references/experiments.md +328 -0
- package/dist/tools-skills/teleport/references/setup.md +157 -0
- package/dist/tools.js +6 -5
- package/dist/{try-C3HW3hPZ.js → try-C8QQbG0b.js} +10 -10
- package/dist/upgrade-CYFdpVpi.js +27 -0
- package/dist/{upgrade-Cw9jVt-r.js → upgrade-D0thxCA4.js} +7 -7
- package/package.json +2 -2
- package/dist/create-DM5Y1Pyk.js +0 -18
- package/dist/held-DVxvPMSG.js +0 -15
- package/dist/login-et319ESO.js +0 -13
- package/dist/pull-h71pL3r_.js +0 -30
- package/dist/push-BIq6R8Ro.js +0 -29
- package/dist/registry-YwzTfCNc.js +0 -22
- package/dist/scan-B36wkZmI.js +0 -4
- package/dist/server-CZwSfzKe.js +0 -33
- package/dist/session-Cip4j99n.js +0 -5
- package/dist/storekit-ELVCMF0X.js +0 -15
- package/dist/upgrade-DVsonzDF.js +0 -27
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
# Set up app to web
|
|
2
|
+
|
|
3
|
+
The playbook for "set up an app-to-web flow" or "an app-to-web experiment".
|
|
4
|
+
Do every step; each ends with how to tell it worked. The recommendations are
|
|
5
|
+
today's (November 2026) and may change. The `superwall-framework` skill
|
|
6
|
+
covers everything about writing the paywall; this file only adds what
|
|
7
|
+
teleport needs.
|
|
8
|
+
|
|
9
|
+
## Checklist
|
|
10
|
+
|
|
11
|
+
- [ ] 1. Prerequisites hold (SDK, web paywall domain, Stripe, app links)
|
|
12
|
+
- [ ] 2. Products: Stripe products for the web, a store product for each fallback
|
|
13
|
+
- [ ] 3. `config.ts`: `teleport.route`, `fallbacks`, direct Apple Pay with prepaid cards blocked
|
|
14
|
+
- [ ] 4. The Apple Pay gate on the push that reaches `teleport.route`
|
|
15
|
+
- [ ] 5. The teleport route sells Stripe on the web and the store in the app
|
|
16
|
+
- [ ] 6. Prepaid cards blocked in Stripe Radar too
|
|
17
|
+
- [ ] 7. Pushed, verified on an iPhone, attached to a campaign
|
|
18
|
+
|
|
19
|
+
## 1. Prerequisites
|
|
20
|
+
|
|
21
|
+
- **SuperwallKit 4.18.0 or later** in the iOS app. On an older SDK, and on
|
|
22
|
+
Android, teleport doesn't run: the route opens in the app and a Stripe
|
|
23
|
+
purchase goes to Superwall's hosted checkout. Read the version from the
|
|
24
|
+
app's package manager, never assume it.
|
|
25
|
+
- **A web paywall domain and Stripe connected** on the Superwall app the
|
|
26
|
+
paywall is pushed to: the teleport page opens on that domain, and Stripe
|
|
27
|
+
takes the payment. Both are dashboard settings; when either is missing,
|
|
28
|
+
say so and stop, the user sets them up.
|
|
29
|
+
- **A way back to the app:** its universal link (associated domains), its
|
|
30
|
+
URL scheme, or both. The framework picks the link; `no_app` from
|
|
31
|
+
`returnToApp()` means neither is set.
|
|
32
|
+
|
|
33
|
+
## 2. Products
|
|
34
|
+
|
|
35
|
+
Stripe products (`{environment}:{priceId}:{offer}`, such as
|
|
36
|
+
`live:price_123:7days-free`) are what the web page sells. Give each one a
|
|
37
|
+
store product to fall back to in the app. Never hardcode a price: the stores
|
|
38
|
+
price them at runtime. Create what's missing with `superwall products
|
|
39
|
+
create` (the `superwall-framework` skill's `references/cli.md`); list first.
|
|
40
|
+
|
|
41
|
+
## 3. `config.ts`
|
|
42
|
+
|
|
43
|
+
```ts
|
|
44
|
+
import { definePaywall } from "superwall/config";
|
|
45
|
+
|
|
46
|
+
export default definePaywall({
|
|
47
|
+
name: "Web checkout",
|
|
48
|
+
teleport: {
|
|
49
|
+
route: "plan", // the web half opens here; prepared, warmed and pre-rendered
|
|
50
|
+
fallbacks: { monthly: "annual" }, // "Continue In-App Instead" on the teleport screen
|
|
51
|
+
},
|
|
52
|
+
checkout: { mode: "applePay", prepaidCards: "block" },
|
|
53
|
+
products: { monthly: "live:price_MONTHLY:7days-free", annual: "pro_5999_year" },
|
|
54
|
+
});
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
- `route` is required by this playbook even though the type makes it
|
|
58
|
+
optional: it is what makes the browser open at once.
|
|
59
|
+
- `checkout` only applies to the web half here: inside the iOS app a
|
|
60
|
+
purchase never uses it. `"applePay"` is direct Apple Pay: Apple's sheet
|
|
61
|
+
opens on the tap, and Stripe's card sheet is only the fallback where
|
|
62
|
+
Apple Pay can't open. Always use it on a teleport paywall; `"sheet"`
|
|
63
|
+
(Stripe's embedded checkout) makes every shopper start from a card form.
|
|
64
|
+
A teleport page left without `checkout` uses `"applePay"` too, but write
|
|
65
|
+
it so `prepaidCards` has a place.
|
|
66
|
+
- **Stripe Managed Payments:** direct Apple Pay is not available with it.
|
|
67
|
+
A Managed Payments checkout session comes back as Stripe's embedded
|
|
68
|
+
checkout, so `useApplePay(product).product` reads `session_unsupported`
|
|
69
|
+
and the tap opens the card sheet. Ask the user whether their Stripe
|
|
70
|
+
account uses Managed Payments; when it does, recommend direct Apple Pay
|
|
71
|
+
and let them choose `checkout: { mode: "applePay", managedPayments:
|
|
72
|
+
false, prepaidCards: "block" }` for this paywall (Stripe stops acting as
|
|
73
|
+
merchant of record on it). Their call, not yours.
|
|
74
|
+
- Leave `completion` (`"confirmation"`) and `introductoryOfferEligibility`
|
|
75
|
+
(`"automatic"`) at their defaults unless the user is testing them
|
|
76
|
+
([experiments.md](experiments.md)).
|
|
77
|
+
|
|
78
|
+
## 4. The Apple Pay gate
|
|
79
|
+
|
|
80
|
+
The push that reaches `teleport.route` decides whether the shopper goes to
|
|
81
|
+
the web:
|
|
82
|
+
|
|
83
|
+
```tsx
|
|
84
|
+
const applePay = useApplePay();
|
|
85
|
+
router.push("plan", { teleport: applePay.available });
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
`available` is Apple's own card check
|
|
89
|
+
(`ApplePaySession.canMakePaymentsWithActiveCard`), the same in the iOS
|
|
90
|
+
app's web view as in a browser; on Android it is `false`
|
|
91
|
+
(`unsupported_browser`), where teleport doesn't run anyway. The answer is
|
|
92
|
+
asked when the paywall opens and cached for the page; an error or a timeout
|
|
93
|
+
is asked again. A tap that must wait for the answer uses
|
|
94
|
+
`const { available } = await checkApplePay()` instead.
|
|
95
|
+
|
|
96
|
+
Verify: in the studio (Chrome) `useApplePay()` reads `false,
|
|
97
|
+
unsupported_browser`, so the push stays in the app. That is expected; the
|
|
98
|
+
teleport itself only runs on an iPhone (step 7).
|
|
99
|
+
|
|
100
|
+
## 5. The teleport route
|
|
101
|
+
|
|
102
|
+
The route runs in two places: on the web page after a teleport, and in the
|
|
103
|
+
app for shoppers without Apple Pay. Branch on `useDevice().host`:
|
|
104
|
+
|
|
105
|
+
- `"ios-sdk"` or `"android-sdk"`: sell the store product. A Stripe
|
|
106
|
+
`purchase()` in the iOS app would teleport again, and the Android app
|
|
107
|
+
can't teleport, so it would open hosted checkout instead.
|
|
108
|
+
- anything else (`"web-teleport"` on the teleport page): sell the Stripe
|
|
109
|
+
product, preselecting `useTeleport().productReference` when the app
|
|
110
|
+
passed one.
|
|
111
|
+
|
|
112
|
+
Keep the first render of the route to what the pre-render knows (locale,
|
|
113
|
+
products and prices, trial, `productReference`); the `superwall-framework`
|
|
114
|
+
skill's teleport rule lists the details.
|
|
115
|
+
|
|
116
|
+
## 6. Prepaid cards in Stripe
|
|
117
|
+
|
|
118
|
+
`prepaidCards: "block"` refuses prepaid cards on Stripe's card sheet and
|
|
119
|
+
hosted checkout. An Apple Pay payment can't be filtered by card type from
|
|
120
|
+
the paywall, so also ask the user to add a rule in the Stripe dashboard
|
|
121
|
+
(Radar → Rules): `Block if :card_funding: = 'prepaid'`, and to check it
|
|
122
|
+
in test mode. That is a person's step; list it in the hand-over.
|
|
123
|
+
|
|
124
|
+
## 7. Push, verify, attach
|
|
125
|
+
|
|
126
|
+
1. `superwall push`, then fix every pre-render warning it prints for the
|
|
127
|
+
teleport route (the page would render in the browser instead).
|
|
128
|
+
2. On an iPhone with a card in Wallet, open the paywall from the app (the
|
|
129
|
+
SDK's debugger, or its placement), tap through to `plan`: the browser
|
|
130
|
+
opens on the plan, Apple Pay pays, "You're all set", Return to App, and
|
|
131
|
+
the app is unlocked.
|
|
132
|
+
3. On an iPhone or simulator with an empty Wallet, the same tap opens
|
|
133
|
+
`plan` in the app with the store product.
|
|
134
|
+
4. On the web page, the pay button opens Apple's sheet straight away, not
|
|
135
|
+
a card form. A card form means `"sheet"` mode or Managed Payments
|
|
136
|
+
(step 3).
|
|
137
|
+
5. In the browser, cancel the payment and use Continue In-App Instead on
|
|
138
|
+
the teleport screen: the store sheet opens for the fallback.
|
|
139
|
+
6. `superwall promote` (or `publish`), then attach the paywall to its
|
|
140
|
+
campaign (the `superwall` skill's dashboard workflow). For an
|
|
141
|
+
experiment, each variant is its own paywall: see
|
|
142
|
+
[experiments.md](experiments.md#ab-tests-one-paywall-per-variant).
|
|
143
|
+
|
|
144
|
+
## Pitfalls
|
|
145
|
+
|
|
146
|
+
- Teleporting a route other than `teleport.route` with
|
|
147
|
+
`router.push(route, { teleport: true })`: it opens cold. Make it the
|
|
148
|
+
route, or call `useTeleport().prefetch(route)` when it must stay
|
|
149
|
+
another one.
|
|
150
|
+
- Reading `useApplePay()?.available`: it is always defined; read it
|
|
151
|
+
without `?.`. `useVariables().device.isApplePayAvailable` is deprecated
|
|
152
|
+
and always `true` in the app.
|
|
153
|
+
- Answers kept in component state are lost on the web: keep what the web
|
|
154
|
+
half needs in `useQueryState`, which the teleport carries along.
|
|
155
|
+
- Returning to the app with `openDeepLink` or a hand-built link: use
|
|
156
|
+
`useTeleport().returnToApp()`, or `close()` / `router.back()` on the
|
|
157
|
+
first web route.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { T as isNonInteractive, c as CHANNELS, s as CHANNEL, v as TELEMETRY_HOST, x as VERSION, y as TELEMETRY_KEY } from "./environment-
|
|
2
|
-
import { _ as writeTelemetryNoticeShown, c as readSkillsSync, g as writeSkillsSync, t as readAnonymousId, u as telemetryNoticeShown } from "./config-
|
|
1
|
+
import { T as isNonInteractive, c as CHANNELS, s as CHANNEL, v as TELEMETRY_HOST, x as VERSION, y as TELEMETRY_KEY } from "./environment-Dn7irhZr.js";
|
|
2
|
+
import { _ as writeTelemetryNoticeShown, c as readSkillsSync, g as writeSkillsSync, t as readAnonymousId, u as telemetryNoticeShown } from "./config-DCqRQTJ4.js";
|
|
3
3
|
import { n as ui } from "./ui-hFgji1e8.js";
|
|
4
|
-
import { n as withSpinner } from "./spinner-
|
|
5
|
-
import { i as packagedDir, t as AGENT_SKILLS_DIR } from "./paths-
|
|
4
|
+
import { n as withSpinner } from "./spinner-Dcr-Dqdi.js";
|
|
5
|
+
import { i as packagedDir, t as AGENT_SKILLS_DIR } from "./paths-Cb1RfjaX.js";
|
|
6
6
|
import { execFile, spawn } from "node:child_process";
|
|
7
7
|
import { appendFileSync, existsSync, mkdtempSync, readFileSync, readdirSync, rmSync, writeFileSync } from "node:fs";
|
|
8
8
|
import { tmpdir } from "node:os";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import "./token-
|
|
2
|
-
import "./storage-
|
|
3
|
-
import "./environment-
|
|
4
|
-
import "./config-
|
|
5
|
-
import { a as bundledSkills, c as knownSkills, d as readBundledSkill, f as runSkills, h as updateSkills, i as SUPERWALL_SKILLS_SOURCE, l as normalizeSkillFrontmatter, m as skillsRefFor, n as SKILLS_INSTALL_SOURCE, o as checkSkillsSync, p as skillSummary, r as SKILLS_REF, s as ensureSkillsCurrent, t as PLAYBOOKS, u as normalizeSkillsDir } from "./skills-
|
|
1
|
+
import "./token-CKCBQ4I8.js";
|
|
2
|
+
import "./storage-DdIAHolY.js";
|
|
3
|
+
import "./environment-Dn7irhZr.js";
|
|
4
|
+
import "./config-DCqRQTJ4.js";
|
|
5
|
+
import { a as bundledSkills, c as knownSkills, d as readBundledSkill, f as runSkills, h as updateSkills, i as SUPERWALL_SKILLS_SOURCE, l as normalizeSkillFrontmatter, m as skillsRefFor, n as SKILLS_INSTALL_SOURCE, o as checkSkillsSync, p as skillSummary, r as SKILLS_REF, s as ensureSkillsCurrent, t as PLAYBOOKS, u as normalizeSkillsDir } from "./skills-DnegE1A6.js";
|
|
6
6
|
import "./ui-hFgji1e8.js";
|
|
7
|
-
import "./spinner-
|
|
8
|
-
import "./paths-
|
|
7
|
+
import "./spinner-Dcr-Dqdi.js";
|
|
8
|
+
import "./paths-Cb1RfjaX.js";
|
|
9
9
|
|
|
10
10
|
export { PLAYBOOKS, SKILLS_INSTALL_SOURCE, SKILLS_REF, SUPERWALL_SKILLS_SOURCE, bundledSkills, checkSkillsSync, ensureSkillsCurrent, knownSkills, normalizeSkillFrontmatter, normalizeSkillsDir, readBundledSkill, runSkills, skillSummary, skillsRefFor, updateSkills };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { b as ApiUnreachableError, y as ApiError } from "./config-
|
|
2
|
-
import { d as linkSourceCommit, f as listAppPaywalls, o as createHeadlessPaywall, v as mintSourceAccess } from "./resources-
|
|
1
|
+
import { b as ApiUnreachableError, y as ApiError } from "./config-DCqRQTJ4.js";
|
|
2
|
+
import { d as linkSourceCommit, f as listAppPaywalls, o as createHeadlessPaywall, v as mintSourceAccess } from "./resources-BaURbSpY.js";
|
|
3
3
|
import { n as ui } from "./ui-hFgji1e8.js";
|
|
4
|
-
import { n as findApplication } from "./lookup-
|
|
4
|
+
import { n as findApplication } from "./lookup-DkcT4E-5.js";
|
|
5
5
|
import { f as readLock, h as writeBinding, s as formatSharedLock } from "./types-Dc9U_4kp.js";
|
|
6
6
|
import { r as pushSourceTree, t as gitAvailable } from "./git-Hf9Wc7Hp.js";
|
|
7
7
|
import { i as LOCK_FILE } from "./scope-Cg1AdAfO.js";
|
|
8
|
-
import { n as writeSourceBase, t as readSourceBase } from "./base-
|
|
8
|
+
import { n as writeSourceBase, t as readSourceBase } from "./base-zc1wl_9b.js";
|
|
9
9
|
import * as fs from "node:fs";
|
|
10
10
|
import * as path from "node:path";
|
|
11
11
|
import { setTimeout } from "node:timers/promises";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { i as NotLoggedInError } from "./token-
|
|
2
|
-
import { d as createCommandOutput, p as writeJson } from "./storage-
|
|
3
|
-
import { s as CHANNEL } from "./environment-
|
|
4
|
-
import { y as ApiError } from "./config-
|
|
1
|
+
import { i as NotLoggedInError } from "./token-CKCBQ4I8.js";
|
|
2
|
+
import { d as createCommandOutput, p as writeJson } from "./storage-DdIAHolY.js";
|
|
3
|
+
import { s as CHANNEL } from "./environment-Dn7irhZr.js";
|
|
4
|
+
import { y as ApiError } from "./config-DCqRQTJ4.js";
|
|
5
5
|
import { n as ui, r as useRenderer } from "./ui-hFgji1e8.js";
|
|
6
6
|
import pc from "picocolors";
|
|
7
7
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import "./token-
|
|
2
|
-
import "./storage-
|
|
3
|
-
import "./environment-
|
|
4
|
-
import { y as ApiError } from "./config-
|
|
5
|
-
import "./orgs-
|
|
1
|
+
import "./token-CKCBQ4I8.js";
|
|
2
|
+
import "./storage-DdIAHolY.js";
|
|
3
|
+
import "./environment-Dn7irhZr.js";
|
|
4
|
+
import { y as ApiError } from "./config-DCqRQTJ4.js";
|
|
5
|
+
import "./orgs-ltP8H0Nl.js";
|
|
6
6
|
import "./types-Dc9U_4kp.js";
|
|
7
7
|
import "./scope-Cg1AdAfO.js";
|
|
8
|
-
import { D as requestDeploy, T as listVersions, a as latestManifest, b as getBuild, c as openLink, d as resolveArtifact, f as roleCanApprove, l as pickVersion, n as awaitingInstall, o as newestFirst, p as visibilityOf, w as listMembers, x as getMe } from "./resolve-
|
|
8
|
+
import { D as requestDeploy, T as listVersions, a as latestManifest, b as getBuild, c as openLink, d as resolveArtifact, f as roleCanApprove, l as pickVersion, n as awaitingInstall, o as newestFirst, p as visibilityOf, w as listMembers, x as getMe } from "./resolve-B4bd3Qjl.js";
|
|
9
9
|
import { t as ArtifactError } from "./project-BomArwSj.js";
|
|
10
10
|
|
|
11
11
|
//#region src/core/artifacts/status.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { f as formatJson } from "./storage-
|
|
2
|
-
import { O as field, h as listResource, k as isRecord } from "./resources-
|
|
3
|
-
import { t as apiCall } from "./spinner-
|
|
4
|
-
import { a as pickScope } from "./scope-
|
|
1
|
+
import { f as formatJson } from "./storage-DdIAHolY.js";
|
|
2
|
+
import { O as field, h as listResource, k as isRecord } from "./resources-BaURbSpY.js";
|
|
3
|
+
import { t as apiCall } from "./spinner-Dcr-Dqdi.js";
|
|
4
|
+
import { a as pickScope } from "./scope-DDYLQeZw.js";
|
|
5
5
|
import { r as textOf } from "./input-DOT_2Zvb.js";
|
|
6
6
|
import { writeFileSync } from "node:fs";
|
|
7
7
|
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import "./token-CKCBQ4I8.js";
|
|
2
|
+
import "./storage-DdIAHolY.js";
|
|
3
|
+
import "./environment-Dn7irhZr.js";
|
|
4
|
+
import "./config-DCqRQTJ4.js";
|
|
5
|
+
import "./resources-BaURbSpY.js";
|
|
6
|
+
import "./orgs-ltP8H0Nl.js";
|
|
7
|
+
import "./ui-hFgji1e8.js";
|
|
8
|
+
import "./spinner-Dcr-Dqdi.js";
|
|
9
|
+
import "./org-BV8wwxwc.js";
|
|
10
|
+
import "./lookup-DkcT4E-5.js";
|
|
11
|
+
import "./scope-DDYLQeZw.js";
|
|
12
|
+
import "./input-DOT_2Zvb.js";
|
|
13
|
+
import { n as generateStoreKit, r as writeStoreKit, t as describeSkipped } from "./storekit-De998QOt.js";
|
|
14
|
+
|
|
15
|
+
export { describeSkipped, generateStoreKit, writeStoreKit };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { h as Integration } from "./environment-
|
|
2
|
-
import { c as createProject, m as listProjects, r as createApplication, y as platformLabel } from "./resources-
|
|
1
|
+
import { h as Integration } from "./environment-Dn7irhZr.js";
|
|
2
|
+
import { c as createProject, m as listProjects, r as createApplication, y as platformLabel } from "./resources-BaURbSpY.js";
|
|
3
3
|
import { n as ui } from "./ui-hFgji1e8.js";
|
|
4
|
-
import { n as withSpinner } from "./spinner-
|
|
5
|
-
import { n as orgForNewProject } from "./org-
|
|
4
|
+
import { n as withSpinner } from "./spinner-Dcr-Dqdi.js";
|
|
5
|
+
import { n as orgForNewProject } from "./org-BV8wwxwc.js";
|
|
6
6
|
import pc from "picocolors";
|
|
7
7
|
|
|
8
8
|
//#region src/core/account/bind.ts
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: teleport
|
|
3
|
+
description: Set up an app-to-web flow or experiment with the superwall framework's teleport — the shopper starts on a paywall or onboarding in the iOS app and finishes on the web, paying with Apple Pay through Stripe, and the app is credited on its own. Covers the recommended setup (`teleport.route` in config.ts, the Apple Pay gate with `useApplePay().available` and `router.push(route, { teleport: false })`, `teleport.fallbacks`, blocking prepaid cards), what buying a Stripe product inside the app does, direct Apple Pay checkout (not with Stripe Managed Payments), A/B testing teleport by paywall in a campaign, and a catalogue of setups and experiments (web pricing, discounts, failure rescue, abandonment offers, custom teleport screens, trial eligibility, `completion`, attribution). Use when the user asks to "set up app to web", "app-to-web experiment", "teleport", "send users to web checkout from the app", "sell on the web from iOS", "Stripe / Apple Pay from the app", or to test web checkout against the App Store. Needs the superwall-framework skill for everything else about the paywall.
|
|
4
|
+
user-invocable: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Teleport: app to web
|
|
8
|
+
|
|
9
|
+
App to web means the shopper starts in the iOS app and finishes on the web:
|
|
10
|
+
a paywall shown by SuperwallKit 4.18+ opens one of its routes in the
|
|
11
|
+
shopper's browser, they pay there with Apple Pay (Stripe), and the app is
|
|
12
|
+
credited without a restore. With the superwall framework this is one key,
|
|
13
|
+
`teleport`, in the paywall's `config.ts`; the same paywall runs on both
|
|
14
|
+
sides, so nothing is built twice. Everything about writing the paywall
|
|
15
|
+
itself (routes, hooks, layout, push and publish) is in the
|
|
16
|
+
`superwall-framework` skill; this skill is how to set up teleport well.
|
|
17
|
+
|
|
18
|
+
The framework is headless React: every screen, offer, branch and
|
|
19
|
+
fallback here is code the user owns, so anything they can describe they can
|
|
20
|
+
build. Treat the setup below as the baseline and
|
|
21
|
+
[references/experiments.md](references/experiments.md) as the menu of what
|
|
22
|
+
else is possible; offer from it.
|
|
23
|
+
|
|
24
|
+
These are **today's recommendations** (November 2026). They come from what
|
|
25
|
+
converts so far and may change; when the user's own results disagree, theirs
|
|
26
|
+
win. Say so when you hand a setup over.
|
|
27
|
+
|
|
28
|
+
## The rules
|
|
29
|
+
|
|
30
|
+
1. **Teleport through `teleport.route` in `config.ts`, always.** Name the
|
|
31
|
+
route the web half opens on: `teleport: { route: "plan" }`. A paywall
|
|
32
|
+
with `teleport.route` prepares that teleport and warms the web page the
|
|
33
|
+
moment it opens, asks Apple about Apple Pay at the same time, and
|
|
34
|
+
`superwall push` pre-renders the route so the browser paints it before
|
|
35
|
+
any script runs. A route teleported only with
|
|
36
|
+
`router.push(route, { teleport: true })` gets none of that and opens
|
|
37
|
+
cold. Never hand-build a link or call `openExternalUrl` to reach the web.
|
|
38
|
+
2. **Send only shoppers with Apple Pay to the web.** App to web converts
|
|
39
|
+
well when the shopper pays with a double click; typing a card in a
|
|
40
|
+
browser does not. Read `useApplePay().available` and push the route with
|
|
41
|
+
`{ teleport: applePay.available }`: `true` teleports, `false` pushes the
|
|
42
|
+
same route in the app (`teleport: false` overrides `teleport.route`), so
|
|
43
|
+
the page is still warmed and checked. `false` includes `checking`, the
|
|
44
|
+
first moments before Apple answers; it is cached for the page, and the
|
|
45
|
+
paywall asked when it opened, so by the shopper's tap it has almost
|
|
46
|
+
always answered. Call `await checkApplePay()` instead when a tap must
|
|
47
|
+
wait for the real answer (at most 1.5 s, never `checking`).
|
|
48
|
+
3. **In the app, sell store products; on the web, Stripe products.** The
|
|
49
|
+
route pushed in the app (no Apple Pay) offers the App Store product;
|
|
50
|
+
branch on `useDevice().host` (`"ios-sdk"` or `"android-sdk"` in an
|
|
51
|
+
app, `"web-teleport"` on the teleport page), never on the URL.
|
|
52
|
+
`purchase()` of a Stripe product inside the app teleports: to
|
|
53
|
+
`teleport.route` with the tapped product preselected there
|
|
54
|
+
(`useTeleport().productReference`), or, without `teleport.route`, to
|
|
55
|
+
the route it was tapped on, cold. That is fine as a deliberate path,
|
|
56
|
+
never as a side effect of the in-app branch.
|
|
57
|
+
4. **Map every Stripe product to a store product in `teleport.fallbacks`.**
|
|
58
|
+
While the shopper is in the browser the app shows Superwall's teleport
|
|
59
|
+
screen; `fallbacks` adds "Continue In-App Instead", which buys the store
|
|
60
|
+
product. It is the way back for anyone who changes their mind.
|
|
61
|
+
5. **Use direct Apple Pay, and block prepaid cards:** `checkout: { mode:
|
|
62
|
+
"applePay", prepaidCards: "block" }`. Direct Apple Pay opens Apple's own
|
|
63
|
+
sheet on the tap, a double click and done; it converts better than
|
|
64
|
+
Stripe's embedded card sheet (`"sheet"`), so never pick `"sheet"` for a
|
|
65
|
+
teleport paywall. It is **not available with Stripe Managed Payments**: a
|
|
66
|
+
Managed Payments session can't be paid with Apple Pay directly
|
|
67
|
+
(`useApplePay(product).product.reason` is `session_unsupported`) and the
|
|
68
|
+
shopper gets the card sheet instead. When the account uses Managed
|
|
69
|
+
Payments, tell the user, recommend direct Apple Pay, and let them decide
|
|
70
|
+
whether to set `managedPayments: false` in `checkout` for this paywall
|
|
71
|
+
(they give up Stripe acting as merchant of record on it). Prepaid cards
|
|
72
|
+
are how free trials are abused; `prepaidCards` holds on the card sheet,
|
|
73
|
+
but Apple Pay itself can't be filtered by card type, so also add a Radar
|
|
74
|
+
rule in the Stripe dashboard (see setup).
|
|
75
|
+
6. **A/B test with separate paywalls, not branches in one.** Each variant is
|
|
76
|
+
its own paywall directory with its own `teleport.route`, attached as its
|
|
77
|
+
own variant in a campaign. A flag inside one paywall that decides which
|
|
78
|
+
route teleports loses the preparation, warm-up and pre-render for every
|
|
79
|
+
route but the configured one.
|
|
80
|
+
|
|
81
|
+
## Worked example
|
|
82
|
+
|
|
83
|
+
The `teleport` example (`superwall create --example teleport`) is the full
|
|
84
|
+
flow; this is the shape with the rules above applied. `monthly` and `pro`
|
|
85
|
+
are Stripe products, `annual` the App Store one.
|
|
86
|
+
|
|
87
|
+
```ts
|
|
88
|
+
// paywalls/web-checkout/config.ts
|
|
89
|
+
import { definePaywall } from "superwall/config";
|
|
90
|
+
|
|
91
|
+
export default definePaywall({
|
|
92
|
+
name: "Web checkout",
|
|
93
|
+
teleport: { route: "plan", fallbacks: { monthly: "annual", pro: "annual" } },
|
|
94
|
+
checkout: { mode: "applePay", prepaidCards: "block" },
|
|
95
|
+
products: {
|
|
96
|
+
monthly: "live:price_MONTHLY:7days-free",
|
|
97
|
+
pro: "live:price_PRO:no-trial",
|
|
98
|
+
annual: "pro_5999_year",
|
|
99
|
+
},
|
|
100
|
+
});
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
```tsx
|
|
104
|
+
// paywalls/web-checkout/app/goal.tsx — in the app
|
|
105
|
+
import { useApplePay } from "superwall/hooks";
|
|
106
|
+
import { useRouter } from "superwall/navigation";
|
|
107
|
+
|
|
108
|
+
export default function Goal() {
|
|
109
|
+
const router = useRouter();
|
|
110
|
+
const applePay = useApplePay();
|
|
111
|
+
|
|
112
|
+
return (
|
|
113
|
+
<button
|
|
114
|
+
type="button"
|
|
115
|
+
onClick={() => {
|
|
116
|
+
// Apple Pay set up: plan opens in the browser. Otherwise: plan, in the app.
|
|
117
|
+
router.push("plan", { teleport: applePay.available });
|
|
118
|
+
}}
|
|
119
|
+
>
|
|
120
|
+
Continue
|
|
121
|
+
</button>
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
```tsx
|
|
127
|
+
// paywalls/web-checkout/app/plan.tsx — on the web, or in the app without Apple Pay
|
|
128
|
+
import { useDevice, useProducts, usePurchase } from "superwall/hooks";
|
|
129
|
+
|
|
130
|
+
export default function Plan() {
|
|
131
|
+
const { host } = useDevice();
|
|
132
|
+
const { getProduct } = useProducts();
|
|
133
|
+
const { purchase } = usePurchase();
|
|
134
|
+
// In an app sell the store product: a Stripe purchase in the iOS app would
|
|
135
|
+
// teleport again, and the Android app can't teleport at all.
|
|
136
|
+
const inApp = host === "ios-sdk" || host === "android-sdk";
|
|
137
|
+
const reference = inApp ? "annual" : "monthly";
|
|
138
|
+
const product = getProduct(reference);
|
|
139
|
+
|
|
140
|
+
return (
|
|
141
|
+
<button type="button" onClick={() => void purchase(reference)}>
|
|
142
|
+
{product?.variables.price ? `Subscribe for ${product.variables.price}` : "Subscribe"}
|
|
143
|
+
</button>
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## Where to go next
|
|
149
|
+
|
|
150
|
+
| The job | Read |
|
|
151
|
+
| --- | --- |
|
|
152
|
+
| Set up app to web end to end: prerequisites, the paywall, products, the campaign, verifying on a device | [references/setup.md](references/setup.md) |
|
|
153
|
+
| Setups and experiments: A/B tests by paywall, web prices and discounts, email before the teleport, failure and abandonment rescue, a custom teleport screen, trial eligibility, `completion`, attribution, and more | [references/experiments.md](references/experiments.md) |
|
|
154
|
+
| Anything else about the paywall: routes, `useQueryState`, `useTeleport`, layout, push and publish | the `superwall-framework` skill |
|