@superwall/cli 2.6.0 → 2.7.0
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-DfYTDEJy.js} +16 -16
- package/dist/{approve-aPc5RoXB.js → approve-CoQJhii4.js} +7 -7
- package/dist/{assets-PyuXe45Y.js → assets-BN0tFoj7.js} +3 -3
- package/dist/auth.d.ts +1 -1
- package/dist/auth.js +3 -3
- package/dist/{base-CAU0hWoI.js → base-DAnzMjI8.js} +2 -2
- package/dist/{billing-Dt6L_l9R.js → billing-CFGrG-WZ.js} +3 -3
- package/dist/{build-CY5FnMNY.js → build-CTBvzIG8.js} +10 -10
- package/dist/{config-DOp5oChe.js → config-CJRNScT0.js} +4 -4
- package/dist/{create-BZL5VH4L.js → create-BLs-0ETi.js} +29 -29
- package/dist/create-C_kjQp0N.js +18 -0
- package/dist/{create-D6w3UL0m.js → create-aWzdpjJU.js} +8 -8
- package/dist/{doctor-C9FR0qw3.js → doctor-ChI2Kfru.js} +21 -21
- package/dist/entry.js +28 -29
- package/dist/{environment-sE2wZYdg.js → environment-BQiaGqjB.js} +1 -1
- package/dist/{existing--peXpOZj.js → existing-Cxg_gSN1.js} +8 -8
- package/dist/{git-Hf9Wc7Hp.js → git-D9ooAMt7.js} +1 -1
- package/dist/held-CQMCqJMa.js +15 -0
- package/dist/{held-CUBCOCGP.js → held-CmvNRCRD.js} +327 -22
- package/dist/{scope-BLLUxbrA.js → input-ApyzIzVy.js} +48 -7
- package/dist/{install-C5d82gZF.js → install-DM0JBdpE.js} +12 -12
- package/dist/{integrate-D8J_X1bj.js → integrate-ZQUaScQ0.js} +21 -22
- package/dist/login-Cnt3UZKV.js +13 -0
- package/dist/{login-DXhm9L0F.js → login-CvzBt9eM.js} +2 -2
- package/dist/{login-C6X7JrhM.js → login-Oo2NWLlX.js} +7 -7
- package/dist/{lookup-DqmIbUkv.js → lookup-CHLrO7v7.js} +3 -3
- package/dist/{migrate-BYF6hKZ2.js → migrate-mFKBset8.js} +30 -30
- package/dist/{notification-url-Bo54nkXv.js → notification-url-Dpx0pbYs.js} +3 -3
- package/dist/{open-xdgXUzaF.js → open-CxgE8kLT.js} +2 -2
- package/dist/{org-BD8U3D1_.js → org-0KDPRSlc.js} +4 -4
- package/dist/{organization-D-ZlB3qU.js → organization-Cg--QQtz.js} +4 -4
- package/dist/{orgs-DQQJ3sw_.js → orgs-Df8DzIav.js} +1 -1
- package/dist/{paths-CIlyzF2I.js → paths-B4FNcaHO.js} +1 -1
- package/dist/{playbook-ecggWGFi.js → playbook-pFhIg_0e.js} +10 -10
- package/dist/{promote-QVMLGYlU.js → promote-Crwz1xI0.js} +23 -23
- package/dist/{pull-CCXhb2a7.js → pull-BixwETu1.js} +10 -10
- package/dist/pull-C0gY7HGj.js +30 -0
- package/dist/{pull-CrdsfsAl.js → pull-D8GfsKha.js} +30 -30
- package/dist/{push-DJMGG7zW.js → push-BKoav_FU.js} +10 -10
- package/dist/{push-DiMDwGfe.js → push-BNFvZHUM.js} +8 -8
- package/dist/push-DOaBj8hr.js +29 -0
- package/dist/push-uWv5P0LA.js +21 -0
- package/dist/{registry-BSnQXft4.js → registry-BPqRG08G.js} +270 -435
- package/dist/registry-DGHTk7l-.js +21 -0
- package/dist/{resolve-DO7bPota.js → resolve-CarLrF4b.js} +3 -3
- package/dist/{resources-XwvXA20E.js → resources-BeXleviK.js} +15 -34
- package/dist/{run-B-YvxfRc.js → run-naBCXCfn.js} +14 -14
- package/dist/{scan-ViBhmrB7.js → scan-CtYVCqDS.js} +1 -1
- package/dist/scan-KWnscsk-.js +4 -0
- package/dist/{sdk-BFunw4Hc.js → sdk-BKVRAv23.js} +2 -2
- package/dist/{selection-C07e_GGY.js → selection-CpEfqw2b.js} +1 -1
- package/dist/{series-B8NJK4yS.js → series-C9OU5kd7.js} +1 -1
- package/dist/server-DjBnyiwD.js +33 -0
- package/dist/{server-CBtHzl9y.js → server-Dp5Imq3v.js} +11 -11
- package/dist/{session-BfVx50iA.js → session-6HA1OwHe.js} +6 -6
- package/dist/session-BatiAUPQ.js +5 -0
- package/dist/{session-BlrwAdGN.js → session-BpLOLurZ.js} +1 -1
- package/dist/{setup-a4B72xJ8.js → setup-RL-5c6SV.js} +10 -10
- package/dist/skills/index.json +5 -0
- package/dist/skills/superwall/SKILL.md +8 -1
- package/dist/skills/superwall/references/api.md +34 -3
- package/dist/skills/superwall/references/asc.md +5 -1
- package/dist/skills/superwall/workflows/dashboard/playbook.md +1 -1
- package/dist/skills/superwall/workflows/dashboard/setup.md +6 -2
- package/dist/skills/superwall/workflows/migrate/adapty.md +1 -1
- package/dist/skills/superwall/workflows/migrate/playbook.md +6 -1
- package/dist/skills/superwall/workflows/migrate/qonversion.md +1 -1
- package/dist/skills/superwall/workflows/migrate/revenuecat.md +1 -1
- package/dist/skills/superwall/workflows/placements/android.md +4 -1
- package/dist/skills/superwall/workflows/placements/expo.md +4 -1
- package/dist/skills/superwall/workflows/placements/flutter.md +4 -1
- package/dist/skills/superwall/workflows/placements/ios.md +4 -1
- package/dist/skills/superwall/workflows/placements/playbook.md +6 -1
- package/dist/skills/superwall/workflows/placements/react-native.md +4 -1
- package/dist/skills/superwall/workflows/placements/strategy.md +4 -1
- package/dist/skills/superwall-framework/SKILL.md +105 -26
- package/dist/skills/superwall-framework/references/cli.md +6 -0
- package/dist/skills/superwall-framework/references/elements-checkout.md +457 -0
- package/dist/skills/superwall-framework/references/examples.md +1 -0
- package/dist/skills/superwall-framework/references/layout.md +40 -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-C1ku2pgy.js} +5 -5
- package/dist/{skills-SnxFa2in.js → skills-CkAWJveA.js} +8 -8
- package/dist/{source-push-w7miTr6m.js → source-push-D59hV02W.js} +6 -6
- package/dist/{spinner-BQp7fQvK.js → spinner-hTCJZAoJ.js} +42 -7
- package/dist/{starter-BlJ_InZJ.js → starter-jYb2nmlb.js} +3 -3
- package/dist/{status-DxsIw9zq.js → status-DrD9CHtK.js} +7 -7
- package/dist/{storage-BR6imSqm.js → storage-D0Q4xBi-.js} +1 -1
- package/dist/storekit-CAOpa6_f.js +14 -0
- package/dist/{storekit-BqyujKQ_.js → storekit-TLBxGIrN.js} +5 -5
- package/dist/{theme-Ed0gz6hr.js → theme-Bvv0yrk_.js} +5 -5
- package/dist/{token-CWQ6tdva.js → token-SEWilQo9.js} +1 -1
- package/dist/tools-skills/superwall/SKILL.md +8 -1
- package/dist/tools-skills/superwall/references/api.md +34 -3
- package/dist/tools-skills/superwall/references/asc.md +5 -1
- package/dist/tools-skills/superwall/workflows/dashboard/playbook.md +1 -1
- package/dist/tools-skills/superwall/workflows/dashboard/setup.md +6 -2
- package/dist/tools-skills/superwall/workflows/migrate/adapty.md +1 -1
- package/dist/tools-skills/superwall/workflows/migrate/playbook.md +6 -1
- package/dist/tools-skills/superwall/workflows/migrate/qonversion.md +1 -1
- package/dist/tools-skills/superwall/workflows/migrate/revenuecat.md +1 -1
- package/dist/tools-skills/superwall/workflows/placements/android.md +4 -1
- package/dist/tools-skills/superwall/workflows/placements/expo.md +4 -1
- package/dist/tools-skills/superwall/workflows/placements/flutter.md +4 -1
- package/dist/tools-skills/superwall/workflows/placements/ios.md +4 -1
- package/dist/tools-skills/superwall/workflows/placements/playbook.md +6 -1
- package/dist/tools-skills/superwall/workflows/placements/react-native.md +4 -1
- package/dist/tools-skills/superwall/workflows/placements/strategy.md +4 -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.d.ts +4 -2
- package/dist/tools.js +1357 -1191
- package/dist/{try-C3HW3hPZ.js → try-BpMpLGCs.js} +15 -15
- package/dist/{ui-hFgji1e8.js → ui-Dye-QvEj.js} +26 -1
- package/dist/{upgrade-Cw9jVt-r.js → upgrade-BLFWdbGR.js} +7 -7
- package/dist/upgrade-BzN7PjKg.js +27 -0
- package/package.json +2 -2
- package/dist/create-DM5Y1Pyk.js +0 -18
- package/dist/held-DVxvPMSG.js +0 -15
- package/dist/input-DOT_2Zvb.js +0 -42
- package/dist/login-et319ESO.js +0 -13
- package/dist/pull-h71pL3r_.js +0 -30
- package/dist/push-BIq6R8Ro.js +0 -29
- package/dist/push-D6pJM_vv.js +0 -21
- 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
- /package/dist/{design-lint-mgO-2SGS.js → design-lint-CeG3_ZWN.js} +0 -0
- /package/dist/{devtools-B6Vp6HMy.js → devtools-B3tCQFD-.js} +0 -0
- /package/dist/{download-DhGd4hOB.js → download-DVFHIwia.js} +0 -0
- /package/dist/{project-BomArwSj.js → project-Dml4t7jO.js} +0 -0
- /package/dist/{reports-hbxsd3Zo.js → reports-CJQ-8sj4.js} +0 -0
- /package/dist/{screenshot-file-Dix2Qynm.js → screenshot-file-CcqMLpL5.js} +0 -0
- /package/dist/{source-DQs6iLtC.js → source-Ct9kOCAb.js} +0 -0
- /package/dist/{storage-Bh3wT1Rn.d.ts → storage-BaK-MUM8.d.ts} +0 -0
- /package/dist/{timing-BKEEIBij.js → timing-m0ZUzYiP.js} +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { b as ApiUnreachableError, y as ApiError } from "./config-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { n as findApplication } from "./lookup-
|
|
1
|
+
import { b as ApiUnreachableError, y as ApiError } from "./config-CJRNScT0.js";
|
|
2
|
+
import { n as ui } from "./ui-Dye-QvEj.js";
|
|
3
|
+
import { d as linkSourceCommit, f as listAppPaywalls, o as createHeadlessPaywall, v as mintSourceAccess } from "./resources-BeXleviK.js";
|
|
4
|
+
import { n as findApplication } from "./lookup-CHLrO7v7.js";
|
|
5
5
|
import { f as readLock, h as writeBinding, s as formatSharedLock } from "./types-Dc9U_4kp.js";
|
|
6
|
-
import { r as pushSourceTree, t as gitAvailable } from "./git-
|
|
6
|
+
import { r as pushSourceTree, t as gitAvailable } from "./git-D9ooAMt7.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-DAnzMjI8.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,10 +1,45 @@
|
|
|
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-
|
|
5
|
-
import { n as ui, r as useRenderer } from "./ui-
|
|
1
|
+
import { i as NotLoggedInError } from "./token-SEWilQo9.js";
|
|
2
|
+
import { d as createCommandOutput, p as writeJson } from "./storage-D0Q4xBi-.js";
|
|
3
|
+
import { s as CHANNEL } from "./environment-BQiaGqjB.js";
|
|
4
|
+
import { y as ApiError } from "./config-CJRNScT0.js";
|
|
5
|
+
import { a as isRecord, n as ui, r as useRenderer, s as parseJson } from "./ui-Dye-QvEj.js";
|
|
6
6
|
import pc from "picocolors";
|
|
7
7
|
|
|
8
|
+
//#region src/core/app-store-connect/api/errors.ts
|
|
9
|
+
var AscRequestError = class extends Error {
|
|
10
|
+
constructor(message, status) {
|
|
11
|
+
super(message);
|
|
12
|
+
this.status = status;
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
function statusOf(error) {
|
|
16
|
+
return error instanceof ApiError || error instanceof AscRequestError ? error.status : void 0;
|
|
17
|
+
}
|
|
18
|
+
function describeEntry(entry) {
|
|
19
|
+
const code = typeof entry.code === "string" && entry.code ? entry.code : void 0;
|
|
20
|
+
const text = typeof entry.detail === "string" && entry.detail ? entry.detail : typeof entry.title === "string" && entry.title ? entry.title : void 0;
|
|
21
|
+
const source = isRecord(entry.source) ? entry.source : {};
|
|
22
|
+
const where = typeof source.pointer === "string" ? source.pointer : typeof source.parameter === "string" ? source.parameter : void 0;
|
|
23
|
+
return ` • ${[code, text].filter(Boolean).join(": ")}${where ? ` (${where})` : ""}`;
|
|
24
|
+
}
|
|
25
|
+
function describeAppleError(error) {
|
|
26
|
+
const parsed = error.body ? parseJson(error.body) : void 0;
|
|
27
|
+
const errors = isRecord(parsed) && Array.isArray(parsed.errors) ? parsed.errors.filter(isRecord) : [];
|
|
28
|
+
if (errors.length === 0) return void 0;
|
|
29
|
+
return `App Store Connect refused ${error.request.replace(/^(\w+) \/v2\/organizations\/[^/]+\/app-store-connect\/proxy\/[^/]+/, "$1 ")} (${error.status}):\n${errors.map(describeEntry).join("\n")}`;
|
|
30
|
+
}
|
|
31
|
+
async function withAppleErrors(call) {
|
|
32
|
+
try {
|
|
33
|
+
return await call();
|
|
34
|
+
} catch (error) {
|
|
35
|
+
if (!(error instanceof ApiError)) throw error;
|
|
36
|
+
const described = describeAppleError(error);
|
|
37
|
+
if (!described) throw error;
|
|
38
|
+
throw new AscRequestError(described, error.status);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
//#endregion
|
|
8
43
|
//#region src/program/host.ts
|
|
9
44
|
let installed;
|
|
10
45
|
function useHost(host) {
|
|
@@ -154,7 +189,7 @@ function normalizeError(error) {
|
|
|
154
189
|
code: "invalid_arguments",
|
|
155
190
|
message: error.message
|
|
156
191
|
};
|
|
157
|
-
if (error instanceof ApiError) return {
|
|
192
|
+
if (error instanceof ApiError || error instanceof AscRequestError) return {
|
|
158
193
|
code: "api_error",
|
|
159
194
|
message: error.message,
|
|
160
195
|
status: error.status
|
|
@@ -305,4 +340,4 @@ function apiCall(ctx, label, work) {
|
|
|
305
340
|
}
|
|
306
341
|
|
|
307
342
|
//#endregion
|
|
308
|
-
export { defineCommand as a, onChannel as c, readInput as d, useHost as f, defineCatalog as i, summaryOf as l, withSpinner as n, examplesOf as o, UsageError as r, flagName as s, apiCall as t, currentHost as u };
|
|
343
|
+
export { defineCommand as a, onChannel as c, readInput as d, useHost as f, withAppleErrors as g, statusOf as h, defineCatalog as i, summaryOf as l, describeAppleError as m, withSpinner as n, examplesOf as o, AscRequestError as p, UsageError as r, flagName as s, apiCall as t, currentHost as u };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as MANIFEST_FILE, o as readManifest, r as VENDORED_SDK, t as ArtifactError } from "./project-
|
|
2
|
-
import { i as downloadRepoDir, n as PUBLIC_REPO, r as RepoDownloadError } from "./download-
|
|
3
|
-
import { n as compareVersions, r as vendoredVersion, t as STARTER_DIR } from "./sdk-
|
|
1
|
+
import { n as MANIFEST_FILE, o as readManifest, r as VENDORED_SDK, t as ArtifactError } from "./project-Dml4t7jO.js";
|
|
2
|
+
import { i as downloadRepoDir, n as PUBLIC_REPO, r as RepoDownloadError } from "./download-DVFHIwia.js";
|
|
3
|
+
import { n as compareVersions, r as vendoredVersion, t as STARTER_DIR } from "./sdk-BKVRAv23.js";
|
|
4
4
|
import { execFile } from "node:child_process";
|
|
5
5
|
import * as fs from "node:fs";
|
|
6
6
|
import * as os$1 from "node:os";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import "./token-
|
|
2
|
-
import "./storage-
|
|
3
|
-
import "./environment-
|
|
4
|
-
import { y as ApiError } from "./config-
|
|
5
|
-
import "./orgs-
|
|
1
|
+
import "./token-SEWilQo9.js";
|
|
2
|
+
import "./storage-D0Q4xBi-.js";
|
|
3
|
+
import "./environment-BQiaGqjB.js";
|
|
4
|
+
import { y as ApiError } from "./config-CJRNScT0.js";
|
|
5
|
+
import "./orgs-Df8DzIav.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-
|
|
9
|
-
import { t as ArtifactError } from "./project-
|
|
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-CarLrF4b.js";
|
|
9
|
+
import { t as ArtifactError } from "./project-Dml4t7jO.js";
|
|
10
10
|
|
|
11
11
|
//#region src/core/artifacts/status.ts
|
|
12
12
|
const SHOWN_VERSIONS = 3;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import "./token-SEWilQo9.js";
|
|
2
|
+
import "./storage-D0Q4xBi-.js";
|
|
3
|
+
import "./environment-BQiaGqjB.js";
|
|
4
|
+
import "./config-CJRNScT0.js";
|
|
5
|
+
import "./ui-Dye-QvEj.js";
|
|
6
|
+
import "./orgs-Df8DzIav.js";
|
|
7
|
+
import "./resources-BeXleviK.js";
|
|
8
|
+
import "./spinner-hTCJZAoJ.js";
|
|
9
|
+
import "./org-0KDPRSlc.js";
|
|
10
|
+
import "./lookup-CHLrO7v7.js";
|
|
11
|
+
import "./input-ApyzIzVy.js";
|
|
12
|
+
import { n as generateStoreKit, r as writeStoreKit, t as describeSkipped } from "./storekit-TLBxGIrN.js";
|
|
13
|
+
|
|
14
|
+
export { describeSkipped, generateStoreKit, writeStoreKit };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { f as formatJson } from "./storage-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { r as textOf } from "./input-
|
|
1
|
+
import { f as formatJson } from "./storage-D0Q4xBi-.js";
|
|
2
|
+
import { a as isRecord, i as field } from "./ui-Dye-QvEj.js";
|
|
3
|
+
import { h as listResource } from "./resources-BeXleviK.js";
|
|
4
|
+
import { t as apiCall } from "./spinner-hTCJZAoJ.js";
|
|
5
|
+
import { c as pickScope, r as textOf } from "./input-ApyzIzVy.js";
|
|
6
6
|
import { writeFileSync } from "node:fs";
|
|
7
7
|
|
|
8
8
|
//#region src/core/main/storekit.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { h as Integration } from "./environment-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { n as withSpinner } from "./spinner-
|
|
5
|
-
import { n as orgForNewProject } from "./org-
|
|
1
|
+
import { h as Integration } from "./environment-BQiaGqjB.js";
|
|
2
|
+
import { n as ui } from "./ui-Dye-QvEj.js";
|
|
3
|
+
import { c as createProject, m as listProjects, r as createApplication, y as platformLabel } from "./resources-BeXleviK.js";
|
|
4
|
+
import { n as withSpinner } from "./spinner-hTCJZAoJ.js";
|
|
5
|
+
import { n as orgForNewProject } from "./org-0KDPRSlc.js";
|
|
6
6
|
import pc from "picocolors";
|
|
7
7
|
|
|
8
8
|
//#region src/core/account/bind.ts
|
|
@@ -144,12 +144,19 @@ superwall apps list --json
|
|
|
144
144
|
superwall apps get <app> --json # everything about one app
|
|
145
145
|
superwall apps update <app> --bundle-id com.acme.app --json
|
|
146
146
|
superwall paywalls list --app <id|dashboard link> --search onboarding --json
|
|
147
|
-
superwall campaigns create --description "New user paywall" --placement onboarding_complete --app <id> --json
|
|
147
|
+
superwall campaigns create --description "New user paywall" --placement onboarding_complete --paywall <paywall> --app <id> --json
|
|
148
148
|
superwall campaigns audiences --help # what a nested resource can do
|
|
149
149
|
superwall api docs variant # find endpoints by keyword
|
|
150
150
|
superwall api docs /v2/campaigns/{id}/audiences/{audience_id}/variants post # exact body
|
|
151
151
|
```
|
|
152
152
|
|
|
153
|
+
Without `--paywall` (it needs a CLI newer than 2.6.1), the new campaign's
|
|
154
|
+
audience is a 100% holdout: the placement shows no paywall and the SDK reports
|
|
155
|
+
NoAudienceMatch/holdout until a treatment gets traffic, with
|
|
156
|
+
`superwall campaigns variants create <campaign> <audience> --type treatment --paywall <paywall>`.
|
|
157
|
+
Under `--json` the create result carries a `warnings` array when an audience
|
|
158
|
+
shows no paywall.
|
|
159
|
+
|
|
153
160
|
## App Store Connect - App Store Connect API
|
|
154
161
|
|
|
155
162
|
Use when: creating or managing anything in App Store Connect - subscriptions,
|
|
@@ -171,8 +171,28 @@ superwall products create --identifier com.acme.pro.monthly \
|
|
|
171
171
|
superwall products create --identifier pro_monthly --app <custom store id> \
|
|
172
172
|
--price 9.99 --period month --json
|
|
173
173
|
|
|
174
|
-
#
|
|
175
|
-
|
|
174
|
+
# Change a product's trial or period: the CLI reads the product and merges
|
|
175
|
+
# --trial-days, --period and --period-count into its stored subscription.
|
|
176
|
+
# On a one-time product --trial-days needs --period too. Don't combine these
|
|
177
|
+
# flags with --subscription; that is refused. update is destructive: outside a
|
|
178
|
+
# terminal it changes nothing without --yes, so pass it (or --dry-run first).
|
|
179
|
+
superwall products update <id> --trial-days 3 --yes --json
|
|
180
|
+
superwall products update <id> --period year --period-count 1 --yes --json
|
|
181
|
+
|
|
182
|
+
# --subscription replaces the whole subscription as a JSON object; null clears
|
|
183
|
+
# it, so the product becomes one-time.
|
|
184
|
+
superwall products update <id> \
|
|
185
|
+
--subscription '{"period":"year","period_count":1,"trial_period_days":3}' --yes --json
|
|
186
|
+
superwall products update <id> --subscription null --yes --json
|
|
187
|
+
|
|
188
|
+
# Prefer these flags over a raw `superwall patch /v2/products/<id>`. They need
|
|
189
|
+
# a CLI newer than 2.6.1; on 2.6.1 and older --subscription is sent as a string
|
|
190
|
+
# and refused, so use
|
|
191
|
+
# superwall patch /v2/products/<id> -d 'subscription:={"period":"year","period_count":1,"trial_period_days":3}'
|
|
192
|
+
|
|
193
|
+
# Campaigns: a description, the placement that triggers it and the paywall it
|
|
194
|
+
# shows to 100% of users (--paywall needs a CLI newer than 2.6.1)
|
|
195
|
+
superwall campaigns create --description "Onboarding paywall" --placement onboarding_complete --paywall <paywall> --project <id> --app <id> --json
|
|
176
196
|
|
|
177
197
|
# Placements: trigger an existing campaign on another event
|
|
178
198
|
superwall campaigns placements create <campaignId> --event-name onboarding_complete --project <id> --app <id> --json
|
|
@@ -182,6 +202,13 @@ superwall campaigns placements create <campaignId> --event-name onboarding_compl
|
|
|
182
202
|
directly - add the first platform with `apps create` and a project is created
|
|
183
203
|
for you.
|
|
184
204
|
|
|
205
|
+
Without `--paywall`, `campaigns create` seeds its audience with a single
|
|
206
|
+
holdout at 100%: the placement shows no paywall and the SDK reports
|
|
207
|
+
NoAudienceMatch/holdout until a treatment gets traffic. Fix it with
|
|
208
|
+
`superwall campaigns variants create <campaign> <audience> --type treatment --paywall <paywall> --json`.
|
|
209
|
+
Under `--json` the create result carries a `warnings` array whenever an
|
|
210
|
+
audience shows no paywall (holdout-only or disabled); read it before you move on.
|
|
211
|
+
|
|
185
212
|
### StoreKit config
|
|
186
213
|
|
|
187
214
|
```bash
|
|
@@ -192,8 +219,12 @@ superwall products storekit --project <id> [--out Superwall.storekit] --json
|
|
|
192
219
|
`products` is how many were written, `id` is the Superwall product id, and
|
|
193
220
|
`reason` is `other_store`, `no_price` or `no_identifier`. Price a `no_price`
|
|
194
221
|
product with
|
|
222
|
+
`superwall patch /v2/products/<id> -d 'price[amount]:=<minor units>' -d 'price[currency]=USD'`,
|
|
223
|
+
then export again. The warning prints
|
|
195
224
|
`superwall products update <id> --price '{"amount":<minor units>,"currency":"USD"}'`
|
|
196
|
-
(
|
|
225
|
+
for each one (`amount` in minor units, 399 = $3.99), which works on a CLI newer
|
|
226
|
+
than 2.6.1 (add `--yes` outside a terminal); on 2.6.1 and older it fails with a
|
|
227
|
+
400 from the API, so use the `patch` there.
|
|
197
228
|
|
|
198
229
|
## App Store Connect
|
|
199
230
|
|
|
@@ -115,7 +115,11 @@ ends by reporting the product's `state` and anything still `missing` before it
|
|
|
115
115
|
can be submitted. `superwall asc <resource> --help` lists each one's operations.
|
|
116
116
|
|
|
117
117
|
Everything else goes through the raw proxy (`asc get|post|patch|delete /v1/…`),
|
|
118
|
-
which is where validation applies.
|
|
118
|
+
which is where validation applies. The raw writes take `--dry-run` like the
|
|
119
|
+
resource commands (`asc post|patch|delete … --dry-run`): the body is built and
|
|
120
|
+
checked against Apple's schema, then the request is printed and nothing is sent
|
|
121
|
+
(`--json` gives `{ "dryRun": true, "requests": [...] }`). A body the schema
|
|
122
|
+
refuses still fails in dry-run unless you pass `--force`.
|
|
119
123
|
|
|
120
124
|
## Connecting ASC credentials
|
|
121
125
|
|
|
@@ -41,7 +41,7 @@ placement (in code) → campaign (routes it) → audience (who) → paywal
|
|
|
41
41
|
- Otherwise create with real pricing:
|
|
42
42
|
`superwall products create --identifier pro_yearly --price 39.99 --period year --trial-days 7 --entitlement pro --app <id> --json`
|
|
43
43
|
5. **Carry each placement.** `superwall campaigns list --project <id> --app <id> --json`. For each placement not already on
|
|
44
|
-
a campaign: `superwall campaigns create --description "<description>" --placement <placement> --project <id> --app <id> --json` (campaigns require an initial placement;
|
|
44
|
+
a campaign: `superwall campaigns create --description "<description>" --placement <placement> --paywall <paywall> --project <id> --app <id> --json` (campaigns require an initial placement; without `--paywall`, which needs a CLI newer than 2.6.1, the audience is a 100% holdout, the placement shows no paywall and the SDK reports NoAudienceMatch/holdout until `superwall campaigns variants create <campaign> <audience> --type treatment --paywall <paywall> --json`; under `--json` the result carries a `warnings` array when an audience shows no paywall), or add more with `superwall campaigns placements create <campaignId> --event-name <placement> --project <id> --app <id> --json`.
|
|
45
45
|
|
|
46
46
|
## Guardrails
|
|
47
47
|
|
|
@@ -94,12 +94,16 @@ entitlements on its own app. CLI 2.2.1 and older take only the numeric id from
|
|
|
94
94
|
|
|
95
95
|
```bash
|
|
96
96
|
superwall campaigns list --project <id> --app <id> --json
|
|
97
|
-
superwall campaigns create --description "Onboarding" --placement onboarding_complete --project <id> --app <id> --json
|
|
97
|
+
superwall campaigns create --description "Onboarding" --placement onboarding_complete --paywall <paywall> --project <id> --app <id> --json
|
|
98
98
|
superwall campaigns placements create <campaignId> --event-name another_placement --project <id> --app <id> --json
|
|
99
99
|
```
|
|
100
100
|
|
|
101
101
|
- `create` takes a **description**, not an identifier - name it for the surface.
|
|
102
|
-
- A campaign can carry several related placements; call `campaigns
|
|
102
|
+
- A campaign can carry several related placements; call `campaigns placements create` once per placement.
|
|
103
|
+
- Without `--paywall` (it needs a CLI newer than 2.6.1) the audience is a 100% holdout: the placement shows
|
|
104
|
+
no paywall (the SDK reports NoAudienceMatch/holdout) until
|
|
105
|
+
`superwall campaigns variants create <campaign> <audience> --type treatment --paywall <paywall> --json`.
|
|
106
|
+
Under `--json` the create result carries a `warnings` array when an audience shows no paywall.
|
|
103
107
|
- Adding a placement that's already on the campaign is safe to skip - list first.
|
|
104
108
|
|
|
105
109
|
## What the CLI cannot do (leave manual)
|
|
@@ -122,7 +122,7 @@ Produce: product ids, access-level ids (→ entitlements), and one row per `getP
|
|
|
122
122
|
superwall entitlements create --identifier premium --app <appId> --json
|
|
123
123
|
superwall products create --identifier com.app.premium_monthly --name "Premium Monthly" --entitlement premium --app <appId> --json
|
|
124
124
|
superwall products create --identifier com.app.premium_yearly --name "Premium Yearly" --entitlement premium --app <appId> --json
|
|
125
|
-
superwall campaigns create --description "Main paywall" --placement main --project <projectId> --app <appId> --json
|
|
125
|
+
superwall campaigns create --description "Main paywall" --placement main --paywall <paywall> --project <projectId> --app <appId> --json
|
|
126
126
|
superwall campaigns placements create <campaignId> --event-name onboarding --project <projectId> --app <appId> --json
|
|
127
127
|
```
|
|
128
128
|
|
|
@@ -73,6 +73,11 @@ superwall entitlements create --identifier <id> --app <appId> --json
|
|
|
73
73
|
superwall products list --project <projectId> --json
|
|
74
74
|
superwall products create --identifier <storeId> --entitlement <id> --app <appId> --json
|
|
75
75
|
superwall campaigns list --project <projectId> --app <appId> --json
|
|
76
|
-
superwall campaigns create --description "<description>" --placement <placement> --project <projectId> --app <appId> --json
|
|
76
|
+
superwall campaigns create --description "<description>" --placement <placement> --paywall <paywall> --project <projectId> --app <appId> --json
|
|
77
77
|
superwall campaigns placements create <campaignId> --event-name <placement> --project <projectId> --app <appId> --json
|
|
78
78
|
```
|
|
79
|
+
|
|
80
|
+
Without `--paywall` (it needs a CLI newer than 2.6.1) the audience is a 100%
|
|
81
|
+
holdout: the placement shows no paywall and the SDK reports NoAudienceMatch/holdout
|
|
82
|
+
until `superwall campaigns variants create <campaign> <audience> --type treatment --paywall <paywall> --json`.
|
|
83
|
+
Under `--json` the create result carries a `warnings` array when an audience shows no paywall.
|
|
@@ -119,7 +119,7 @@ Produce: product ids, entitlement/permission ids (→ entitlements), and one row
|
|
|
119
119
|
superwall entitlements create --identifier premium --app <appId> --json
|
|
120
120
|
superwall products create --identifier com.app.premium_monthly --name "Premium Monthly" --entitlement premium --app <appId> --json
|
|
121
121
|
superwall products create --identifier com.app.premium_yearly --name "Premium Yearly" --entitlement premium --app <appId> --json
|
|
122
|
-
superwall campaigns create --description "Main paywall" --placement paywall_main --project <projectId> --app <appId> --json
|
|
122
|
+
superwall campaigns create --description "Main paywall" --placement paywall_main --paywall <paywall> --project <projectId> --app <appId> --json
|
|
123
123
|
```
|
|
124
124
|
|
|
125
125
|
Each product MUST grant the entitlements it unlocked in the old provider (`--entitlement <identifier>`, repeat for several); a product with none unlocks nothing. CLI 2.2.1 and older take only the numeric id from `superwall entitlements list --json`.
|
|
@@ -214,7 +214,7 @@ manual create when possible - `superwall asc keys create --help`). Then one camp
|
|
|
214
214
|
a placement per call site:
|
|
215
215
|
|
|
216
216
|
```bash
|
|
217
|
-
superwall campaigns create --description "Main paywall" --placement start_workout --project <projectId> --app <appId> --json
|
|
217
|
+
superwall campaigns create --description "Main paywall" --placement start_workout --paywall <paywall> --project <projectId> --app <appId> --json
|
|
218
218
|
superwall campaigns placements create <campaignId> --event-name unlock_export --project <projectId> --app <appId> --json
|
|
219
219
|
```
|
|
220
220
|
|
|
@@ -147,10 +147,13 @@ A placement is inert without a campaign:
|
|
|
147
147
|
|
|
148
148
|
```bash
|
|
149
149
|
superwall campaigns list --project <id> --app <id> --json
|
|
150
|
-
superwall campaigns create --description "Editor upgrade paywall" --placement unlock_export --project <id> --app <id> --json
|
|
150
|
+
superwall campaigns create --description "Editor upgrade paywall" --placement unlock_export --paywall <paywall> --project <id> --app <id> --json
|
|
151
151
|
superwall campaigns placements create <campaignId> --event-name another_placement --project <id> --app <id> --json
|
|
152
152
|
```
|
|
153
153
|
|
|
154
|
+
Without `--paywall` (it needs a CLI newer than 2.6.1) the campaign's audience is a
|
|
155
|
+
100% holdout and the placement shows no paywall; see `../../references/api.md`.
|
|
156
|
+
|
|
154
157
|
## Pitfalls
|
|
155
158
|
|
|
156
159
|
- **Registering during composition.** Never call `register` in a composable's
|
|
@@ -131,10 +131,13 @@ function AddProjectButton({ count, freeLimit }: { count: number; freeLimit: numb
|
|
|
131
131
|
|
|
132
132
|
```bash
|
|
133
133
|
superwall campaigns list --project <id> --app <id> --json
|
|
134
|
-
superwall campaigns create --description "Editor upgrade paywall" --placement unlock_export --project <id> --app <id> --json
|
|
134
|
+
superwall campaigns create --description "Editor upgrade paywall" --placement unlock_export --paywall <paywall> --project <id> --app <id> --json
|
|
135
135
|
superwall campaigns placements create <campaignId> --event-name another_placement --project <id> --app <id> --json
|
|
136
136
|
```
|
|
137
137
|
|
|
138
|
+
Without `--paywall` (it needs a CLI newer than 2.6.1) the campaign's audience is a
|
|
139
|
+
100% holdout and the placement shows no paywall; see `../../references/api.md`.
|
|
140
|
+
|
|
138
141
|
## Pitfalls
|
|
139
142
|
|
|
140
143
|
- **Registering during render.** Call `registerPlacement` from an event handler
|
|
@@ -113,10 +113,13 @@ ElevatedButton(
|
|
|
113
113
|
|
|
114
114
|
```bash
|
|
115
115
|
superwall campaigns list --project <id> --app <id> --json
|
|
116
|
-
superwall campaigns create --description "Editor upgrade paywall" --placement unlock_export --project <id> --app <id> --json
|
|
116
|
+
superwall campaigns create --description "Editor upgrade paywall" --placement unlock_export --paywall <paywall> --project <id> --app <id> --json
|
|
117
117
|
superwall campaigns placements create <campaignId> --event-name another_placement --project <id> --app <id> --json
|
|
118
118
|
```
|
|
119
119
|
|
|
120
|
+
Without `--paywall` (it needs a CLI newer than 2.6.1) the campaign's audience is a
|
|
121
|
+
100% holdout and the placement shows no paywall; see `../../references/api.md`.
|
|
122
|
+
|
|
120
123
|
## Pitfalls
|
|
121
124
|
|
|
122
125
|
- **Registering inside `build`.** Never call `registerPlacement` from a widget's
|
|
@@ -140,10 +140,13 @@ A placement is inert without a campaign:
|
|
|
140
140
|
|
|
141
141
|
```bash
|
|
142
142
|
superwall campaigns list --project <id> --app <id> --json
|
|
143
|
-
superwall campaigns create --description "Editor upgrade paywall" --placement unlock_export --project <id> --app <id> --json
|
|
143
|
+
superwall campaigns create --description "Editor upgrade paywall" --placement unlock_export --paywall <paywall> --project <id> --app <id> --json
|
|
144
144
|
superwall campaigns placements create <campaignId> --event-name another_placement --project <id> --app <id> --json
|
|
145
145
|
```
|
|
146
146
|
|
|
147
|
+
Without `--paywall` (it needs a CLI newer than 2.6.1) the campaign's audience is a
|
|
148
|
+
100% holdout and the placement shows no paywall; see `../../references/api.md`.
|
|
149
|
+
|
|
147
150
|
## Pitfalls
|
|
148
151
|
|
|
149
152
|
- **Registering inside `body`/render.** Never call `register` from within a
|
|
@@ -46,9 +46,14 @@ Exact API, gating semantics, placement examples, audit checklist, and pitfalls:
|
|
|
46
46
|
A placement cannot present a paywall until a campaign routes it in the dashboard:
|
|
47
47
|
|
|
48
48
|
- `superwall campaigns list --project <id> --app <id> --json` - existing campaigns and placements.
|
|
49
|
-
- `superwall campaigns create --description "<description>" --placement <placement_name> --project <id> --app <id> --json` - create one with its required first placement.
|
|
49
|
+
- `superwall campaigns create --description "<description>" --placement <placement_name> --paywall <paywall> --project <id> --app <id> --json` - create one with its required first placement and the paywall it shows to 100% of users.
|
|
50
50
|
- `superwall campaigns placements create <campaignId> --event-name <placement_name> --project <id> --app <id> --json` - route another placement.
|
|
51
51
|
|
|
52
|
+
Without `--paywall` (it needs a CLI newer than 2.6.1) the audience is a 100%
|
|
53
|
+
holdout: the placement shows no paywall and the SDK reports NoAudienceMatch/holdout
|
|
54
|
+
until `superwall campaigns variants create <campaign> <audience> --type treatment --paywall <paywall> --json`.
|
|
55
|
+
Under `--json` the create result carries a `warnings` array when an audience shows no paywall.
|
|
56
|
+
|
|
52
57
|
Analytics-only, future, and paused placements may intentionally remain unrouted.
|
|
53
58
|
For placements expected to present now, use one campaign per distinct paywall
|
|
54
59
|
surface - not one per trigger. Don't create duplicates.
|
|
@@ -116,10 +116,13 @@ function AddProjectButton({ count, freeLimit }: { count: number; freeLimit: numb
|
|
|
116
116
|
|
|
117
117
|
```bash
|
|
118
118
|
superwall campaigns list --project <id> --app <id> --json
|
|
119
|
-
superwall campaigns create --description "Editor upgrade paywall" --placement unlock_export --project <id> --app <id> --json
|
|
119
|
+
superwall campaigns create --description "Editor upgrade paywall" --placement unlock_export --paywall <paywall> --project <id> --app <id> --json
|
|
120
120
|
superwall campaigns placements create <campaignId> --event-name another_placement --project <id> --app <id> --json
|
|
121
121
|
```
|
|
122
122
|
|
|
123
|
+
Without `--paywall` (it needs a CLI newer than 2.6.1) the campaign's audience is a
|
|
124
|
+
100% holdout and the placement shows no paywall; see `../../references/api.md`.
|
|
125
|
+
|
|
123
126
|
## Pitfalls
|
|
124
127
|
|
|
125
128
|
- **Registering during render.** Call `register` from an event handler or effect,
|
|
@@ -213,10 +213,13 @@ user sees. Analytics-only or future placements can remain unrouted intentionally
|
|
|
213
213
|
|
|
214
214
|
```bash
|
|
215
215
|
superwall campaigns list --project <id> --app <id> --json
|
|
216
|
-
superwall campaigns create --description "Editor upgrade paywall" --placement unlock_export --project <id> --app <id> --json
|
|
216
|
+
superwall campaigns create --description "Editor upgrade paywall" --placement unlock_export --paywall <paywall> --project <id> --app <id> --json
|
|
217
217
|
superwall campaigns placements create <campaignId> --event-name another_placement --project <id> --app <id> --json
|
|
218
218
|
```
|
|
219
219
|
|
|
220
|
+
Without `--paywall` (it needs a CLI newer than 2.6.1) the campaign's audience is a
|
|
221
|
+
100% holdout and the placement shows no paywall; see `../../references/api.md`.
|
|
222
|
+
|
|
220
223
|
Rule of thumb: one campaign per distinct paywall surface/decision (onboarding,
|
|
221
224
|
settings upgrade, win-back), routing the placements that belong to it - not one
|
|
222
225
|
campaign per trigger, and no duplicates.
|
|
@@ -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 |
|