@superwall/cli 2.2.0 → 2.3.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/README.md +26 -11
- package/dist/{apple-Bcr_PteR.js → apple-D79LBw5E.js} +13 -13
- package/dist/assets-Diivv88t.js +89 -0
- package/dist/auth.d.ts +1 -1
- package/dist/auth.js +3 -3
- package/dist/{billing-CWM1ds3K.js → billing-CCuMv6mh.js} +3 -3
- package/dist/{bind-DEYxsnZD.js → bind-CVRlFlRo.js} +4 -4
- package/dist/{build--oQKfZU6.js → build-BCq0cGh-.js} +7 -6
- package/dist/{client-CimFymxG.js → client-CYtQvWJR.js} +3 -3
- package/dist/{create-BG9n4fvs.js → create-BZyUW60x.js} +28 -226
- package/dist/{create-DTAyHkxb.js → create-BaP6hoQ1.js} +6 -6
- package/dist/create-DNfuZ9os.js +19 -0
- package/dist/{doctor-BkygMUe2.js → doctor-kx01VvQX.js} +6 -6
- package/dist/{drivers-C6eXj5-r.js → drivers-D0818zGc.js} +3 -3
- package/dist/entry.js +19 -19
- package/dist/{environment-CQn323uB.js → environment-a7W-0wg0.js} +1 -1
- package/dist/{existing-CvOluc9U.js → existing-B7qxYiUX.js} +2 -2
- package/dist/held-C4BiAQ_X.js +16 -0
- package/dist/{held-QM7yfrXq.js → held-CEyXc1SI.js} +6 -6
- package/dist/{integrate-Ci_MLkQG.js → integrate-RK5U0GTQ.js} +22 -22
- package/dist/login-DV70XgZO.js +16 -0
- package/dist/{login-BIAWgdzM.js → login-DrMLxlF4.js} +6 -6
- package/dist/{login-DLi71nJq.js → login-NxCl2WuU.js} +1 -1
- package/dist/{lookup-DZFrfzO0.js → lookup-Dor6ch5A.js} +2 -2
- package/dist/{migrate-BKF1WckS.js → migrate-CjSpcnNu.js} +25 -22
- package/dist/{open-BjvGVwJf.js → migration-MlzZHGP-.js} +22 -56
- package/dist/{notification-url-erXQ1edb.js → notification-url-C_QXtljc.js} +2 -2
- package/dist/open-CBW0Cuog.js +41 -0
- package/dist/{org-CvPGVSBF.js → org-BJCyaL1b.js} +2 -2
- package/dist/{paths-oRuC18Kt.js → paths-Cp_lgyWO.js} +1 -1
- package/dist/{playbook-CtTj1HBK.js → playbook-VqV7546k.js} +10 -10
- package/dist/{promote-BkJYISza.js → promote-BSckFPwZ.js} +18 -16
- package/dist/pull-DEumBwvc.js +303 -0
- package/dist/{push-Ul2SW87i.js → push-D-dewDd1.js} +8 -6
- package/dist/push-YEPqa6hs.js +24 -0
- package/dist/{registry-OmPZ6dj0.js → registry-D6M1JxYC.js} +236 -142
- package/dist/{resources-FIrK7pE9.js → resources-DKn4itf3.js} +21 -7
- package/dist/{run-CwEY1eu5.js → run-Ccv5egCC.js} +2 -2
- package/dist/{scan-CpbfZ2ju.js → scan-Be17rMcQ.js} +1 -1
- package/dist/scan-CocGVPe0.js +4 -0
- package/dist/{scope-BSqVfZvy.js → scope-92neiQ2q.js} +5 -4
- package/dist/{selection-CHnVk8uw.js → selection-C5ZY23dQ.js} +16 -96
- package/dist/server-1pOxW1GJ.js +24 -0
- package/dist/{server-D5xl5iKO.js → server-DZ7L28w4.js} +9 -7
- package/dist/{session-BFwasPVq.js → session-CdnUL4zt.js} +444 -243
- package/dist/session-Cm0U68t3.js +6 -0
- package/dist/{session-6lnJ0shD.js → session-gTuw2_8i.js} +1 -1
- package/dist/setup-esb3_a7N.js +216 -0
- package/dist/skills/animate-onboarding/SKILL.md +2 -2
- package/dist/skills/index.json +18 -18
- package/dist/skills/mobile-design/SKILL.md +2 -2
- package/dist/skills/onboarding-questions/SKILL.md +2 -2
- package/dist/skills/superwall/SKILL.md +104 -20
- package/dist/skills/superwall/references/api.md +21 -5
- package/dist/skills/superwall/workflows/dashboard/playbook.md +6 -4
- package/dist/skills/superwall/workflows/dashboard/setup.md +10 -5
- package/dist/skills/superwall/workflows/integrate/playbook.md +4 -2
- package/dist/skills/superwall/workflows/migrate/adapty.md +7 -6
- package/dist/skills/superwall/workflows/migrate/playbook.md +4 -3
- package/dist/skills/superwall/workflows/migrate/qonversion.md +7 -6
- package/dist/skills/superwall/workflows/migrate/revenuecat.md +8 -7
- package/dist/skills/superwall-editor/SKILL.md +52 -1
- package/dist/skills/superwall-framework/SKILL.md +90 -15
- package/dist/skills/superwall-framework/references/cli.md +92 -21
- package/dist/skills/superwall-framework/references/migrate-from-editor.md +6 -2
- package/dist/skills/superwall-framework/references/mobile-design.md +1 -1
- package/dist/{skills-B8uSuanf.js → skills-B_oH2dYK.js} +8 -8
- package/dist/{skills-D7sG0xom.js → skills-miJDcjQ2.js} +4 -4
- package/dist/source-push-NVrs53Uo.js +205 -0
- package/dist/{spinner-TZeZEeVv.js → spinner-D6phP4Af.js} +3 -3
- package/dist/{storage-DqKJe13V.js → storage-BcvKhvzZ.js} +1 -1
- package/dist/storekit-D1A5VHT1.js +16 -0
- package/dist/{storekit-uyT3DWo4.js → storekit-Di3BkafX.js} +3 -3
- package/dist/{telemetry-D_uIIuSk.js → telemetry-BpYXL-z3.js} +1 -1
- package/dist/{token-BJsLGoSX.js → token-4dQOfOaK.js} +1 -1
- package/dist/tools-skills/animate-onboarding/SKILL.md +1 -1
- package/dist/tools-skills/mobile-design/SKILL.md +1 -1
- package/dist/tools-skills/onboarding-questions/SKILL.md +1 -1
- package/dist/tools-skills/superwall/SKILL.md +80 -8
- package/dist/tools-skills/superwall/references/api.md +116 -24
- package/dist/tools-skills/superwall/references/apple-setup.md +316 -0
- package/dist/tools-skills/superwall/references/asc.md +74 -38
- package/dist/tools-skills/superwall/references/data-analytics.md +62 -29
- package/dist/tools-skills/superwall/workflows/dashboard/playbook.md +3 -3
- package/dist/tools-skills/superwall/workflows/dashboard/setup.md +8 -8
- package/dist/tools-skills/superwall/workflows/migrate/adapty.md +6 -6
- package/dist/tools-skills/superwall/workflows/migrate/playbook.md +4 -4
- package/dist/tools-skills/superwall/workflows/migrate/qonversion.md +5 -5
- package/dist/tools-skills/superwall/workflows/migrate/revenuecat.md +6 -6
- package/dist/tools-skills/superwall/workflows/placements/android.md +2 -2
- package/dist/tools-skills/superwall/workflows/placements/expo.md +2 -2
- package/dist/tools-skills/superwall/workflows/placements/flutter.md +2 -2
- package/dist/tools-skills/superwall/workflows/placements/ios.md +2 -2
- package/dist/tools-skills/superwall/workflows/placements/playbook.md +2 -2
- package/dist/tools-skills/superwall/workflows/placements/react-native.md +2 -2
- package/dist/tools-skills/superwall/workflows/placements/strategy.md +2 -2
- package/dist/tools-skills/superwall/workflows/review/playbook.md +1 -1
- package/dist/tools-skills/superwall-editor/SKILL.md +2 -2
- package/dist/tools.d.ts +1 -1
- package/dist/tools.js +222 -109
- package/dist/{upgrade-DV_rmhyV.js → upgrade-BnOq32zn.js} +2 -2
- package/dist/{upgrade-BRM51As6.js → upgrade-Cb6f4S_c.js} +1 -1
- package/package.json +2 -2
- package/dist/create-kT2C9k4h.js +0 -19
- package/dist/held-Bwkhufdj.js +0 -16
- package/dist/login-Dy9N5ZDH.js +0 -16
- package/dist/push-BIizJJOn.js +0 -22
- package/dist/scan-DjyvuWel.js +0 -4
- package/dist/server-BTveynqC.js +0 -22
- package/dist/session-Ds6tLC19.js +0 -6
- package/dist/storekit-C_LFh8qy.js +0 -16
- /package/dist/{reports-D_qbl7_u.js → reports-CwwKLUh0.js} +0 -0
- /package/dist/{storage-BbJF7z3l.d.ts → storage-gRyQetN9.d.ts} +0 -0
|
@@ -10,8 +10,17 @@ Use the CLI for every query. It resolves the current organization and authentica
|
|
|
10
10
|
superwall query "SHOW TABLES FROM sw" --json
|
|
11
11
|
superwall query "SELECT applicationId, name FROM sw.applications_rep FINAL LIMIT 20" --json
|
|
12
12
|
superwall query --file report.sql --json
|
|
13
|
+
superwall query --file revenue.sql --app <id> --json
|
|
13
14
|
```
|
|
14
15
|
|
|
16
|
+
Queries about one app take `--app <id>`: it fills `{app:UInt64}` (used in every
|
|
17
|
+
example below), `{revenue_provider:String}` and
|
|
18
|
+
`{revenue_integrations:Array(String)}` as ClickHouse parameters, so the SQL
|
|
19
|
+
needs no hand-edited ids. Other values go in with `--param`, e.g.
|
|
20
|
+
`--param user_id=abc` for `{user_id:String}`. **Every revenue query filters by
|
|
21
|
+
the app's revenue provider** (see "Revenue provider" below), or it double-counts
|
|
22
|
+
apps that send revenue from both the store and RevenueCat.
|
|
23
|
+
|
|
15
24
|
Agents should reach for `superwall query` proactively for revenue questions,
|
|
16
25
|
subscription health, conversion analysis, user behavior, ad hoc investigation,
|
|
17
26
|
custom dashboards, and reusable reports. Create recurring schedules or send notifications only
|
|
@@ -214,7 +223,7 @@ These are system events emitted by the SDK:
|
|
|
214
223
|
-- Check SDK configuration (purchase controller, StoreKit version)
|
|
215
224
|
SELECT props
|
|
216
225
|
FROM sw.events_rep
|
|
217
|
-
WHERE applicationId = {
|
|
226
|
+
WHERE applicationId = {app:UInt64}
|
|
218
227
|
AND name = 'config_attributes'
|
|
219
228
|
AND ts > toStartOfHour(now() - INTERVAL 1 HOUR) AND ts < now()
|
|
220
229
|
LIMIT 1
|
|
@@ -232,7 +241,7 @@ LIMIT 1
|
|
|
232
241
|
-- Recent event volume by name for an app
|
|
233
242
|
SELECT name, count() as cnt
|
|
234
243
|
FROM sw.events_rep
|
|
235
|
-
WHERE applicationId = {
|
|
244
|
+
WHERE applicationId = {app:UInt64} AND isSandbox = 0
|
|
236
245
|
AND ts > toStartOfHour(now() - INTERVAL 7 DAY) AND ts < now()
|
|
237
246
|
GROUP BY name ORDER BY cnt DESC LIMIT 30
|
|
238
247
|
```
|
|
@@ -299,7 +308,7 @@ SETTINGS index_granularity = 8192
|
|
|
299
308
|
-- Demand score distribution for an app
|
|
300
309
|
SELECT demandScore, count() as cnt
|
|
301
310
|
FROM sw.demand_score_events_rep
|
|
302
|
-
WHERE applicationId = {
|
|
311
|
+
WHERE applicationId = {app:UInt64} AND isSandbox = 0
|
|
303
312
|
AND ts >= now() - INTERVAL 30 DAY AND demandScore >= 0
|
|
304
313
|
GROUP BY demandScore ORDER BY demandScore
|
|
305
314
|
```
|
|
@@ -311,7 +320,7 @@ SELECT name,
|
|
|
311
320
|
quantile(0.5)(demandScore) as p50,
|
|
312
321
|
quantile(0.95)(demandScore) as p95
|
|
313
322
|
FROM sw.demand_score_events_rep
|
|
314
|
-
WHERE applicationId = {
|
|
323
|
+
WHERE applicationId = {app:UInt64} AND isSandbox = 0
|
|
315
324
|
AND ts >= now() - INTERVAL 7 DAY AND demandScore >= 0
|
|
316
325
|
GROUP BY name
|
|
317
326
|
```
|
|
@@ -363,7 +372,7 @@ SELECT name, sum(hourly_uniques) as total
|
|
|
363
372
|
FROM (
|
|
364
373
|
SELECT name, ts, uniqMerge(count) as hourly_uniques
|
|
365
374
|
FROM sw.events_hr_agg
|
|
366
|
-
WHERE applicationId = {
|
|
375
|
+
WHERE applicationId = {app:UInt64} AND isSandbox = 0
|
|
367
376
|
AND ts >= now() - INTERVAL 7 DAY AND ts < now()
|
|
368
377
|
GROUP BY name, ts
|
|
369
378
|
) GROUP BY name ORDER BY total DESC
|
|
@@ -375,7 +384,7 @@ FROM (
|
|
|
375
384
|
-- Hourly unique event count for an app (recent)
|
|
376
385
|
SELECT ts, name, source, uniqMerge(count) as unique_events
|
|
377
386
|
FROM sw.events_hr_agg
|
|
378
|
-
WHERE applicationId = {
|
|
387
|
+
WHERE applicationId = {app:UInt64} AND isSandbox = 0
|
|
379
388
|
AND ts >= now() - INTERVAL 2 DAY AND ts < now()
|
|
380
389
|
GROUP BY ts, name, source
|
|
381
390
|
ORDER BY ts DESC LIMIT 20
|
|
@@ -385,7 +394,7 @@ ORDER BY ts DESC LIMIT 20
|
|
|
385
394
|
-- Check if an app is sending events (last 5 minutes proxy: check last hour)
|
|
386
395
|
SELECT name, uniqMerge(count) as cnt
|
|
387
396
|
FROM sw.events_hr_agg
|
|
388
|
-
WHERE applicationId = {
|
|
397
|
+
WHERE applicationId = {app:UInt64} AND isSandbox = 0
|
|
389
398
|
AND ts >= now() - INTERVAL 1 HOUR AND ts < now()
|
|
390
399
|
GROUP BY name ORDER BY cnt DESC
|
|
391
400
|
```
|
|
@@ -438,7 +447,7 @@ SELECT
|
|
|
438
447
|
JSONExtractString(props, '$subscription_status') as status,
|
|
439
448
|
count() as cnt
|
|
440
449
|
FROM sw.subscription_status_rep FINAL
|
|
441
|
-
WHERE applicationId = {
|
|
450
|
+
WHERE applicationId = {app:UInt64} AND isSandbox = 0 AND isDeleted = 0
|
|
442
451
|
GROUP BY status ORDER BY cnt DESC
|
|
443
452
|
```
|
|
444
453
|
|
|
@@ -448,14 +457,14 @@ SELECT appUserId,
|
|
|
448
457
|
JSONExtractString(props, '$subscription_status') as status,
|
|
449
458
|
ts
|
|
450
459
|
FROM sw.subscription_status_rep FINAL
|
|
451
|
-
WHERE applicationId = {
|
|
460
|
+
WHERE applicationId = {app:UInt64} AND appUserId = {user_id:String} AND isSandbox = 0
|
|
452
461
|
```
|
|
453
462
|
|
|
454
463
|
```sql
|
|
455
464
|
-- Count active subscribers
|
|
456
465
|
SELECT count() as active_subscribers
|
|
457
466
|
FROM sw.subscription_status_rep FINAL
|
|
458
|
-
WHERE applicationId = {
|
|
467
|
+
WHERE applicationId = {app:UInt64} AND isSandbox = 0 AND isDeleted = 0
|
|
459
468
|
AND JSONExtractString(props, '$subscription_status') = 'ACTIVE'
|
|
460
469
|
```
|
|
461
470
|
|
|
@@ -515,8 +524,8 @@ App-specific: `first_name`, `created_at`, `subscription_canceled`, `apns_token`,
|
|
|
515
524
|
-- Get all attributes for a specific user
|
|
516
525
|
SELECT key, type, value, ts
|
|
517
526
|
FROM sw.user_attributes_rep FINAL
|
|
518
|
-
WHERE applicationId = {
|
|
519
|
-
AND appUserId =
|
|
527
|
+
WHERE applicationId = {app:UInt64} AND isSandbox = 0
|
|
528
|
+
AND appUserId = {user_id:String} AND isDeleted = 0
|
|
520
529
|
ORDER BY key
|
|
521
530
|
```
|
|
522
531
|
|
|
@@ -524,7 +533,7 @@ ORDER BY key
|
|
|
524
533
|
-- List available attribute keys for an app
|
|
525
534
|
SELECT key, count() as user_count, any(type) as sample_type
|
|
526
535
|
FROM sw.user_attributes_rep FINAL
|
|
527
|
-
WHERE applicationId = {
|
|
536
|
+
WHERE applicationId = {app:UInt64} AND isSandbox = 0 AND isDeleted = 0
|
|
528
537
|
GROUP BY key ORDER BY user_count DESC LIMIT 30
|
|
529
538
|
```
|
|
530
539
|
|
|
@@ -532,7 +541,7 @@ GROUP BY key ORDER BY user_count DESC LIMIT 30
|
|
|
532
541
|
-- Segment users by an attribute value
|
|
533
542
|
SELECT value as subscription_status, uniq(appUserId) as users
|
|
534
543
|
FROM sw.user_attributes_rep FINAL
|
|
535
|
-
WHERE applicationId = {
|
|
544
|
+
WHERE applicationId = {app:UInt64} AND isSandbox = 0 AND isDeleted = 0
|
|
536
545
|
AND key = 'paying_user'
|
|
537
546
|
GROUP BY value ORDER BY users DESC
|
|
538
547
|
```
|
|
@@ -643,9 +652,32 @@ SETTINGS index_granularity = 8192
|
|
|
643
652
|
##### Source and Integration
|
|
644
653
|
|
|
645
654
|
- **source**: `sdk` (from Superwall SDK `transaction_complete`) or `integration` (from RevenueCat, App Store Connect, etc.)
|
|
646
|
-
- **integration values**: `
|
|
655
|
+
- **integration values**: `app_store_connect`, `google_play`, `stripe`, `revenue_cat`
|
|
647
656
|
- `transaction_complete` events always have source=`sdk`; all other event names come from integrations
|
|
648
657
|
|
|
658
|
+
##### Revenue provider — filter every revenue query by it
|
|
659
|
+
|
|
660
|
+
An app that receives revenue from its store *and* RevenueCat gets the same
|
|
661
|
+
purchase from both. Its **revenue provider** decides which one the dashboard
|
|
662
|
+
counts, and a query must count the same rows to match it:
|
|
663
|
+
|
|
664
|
+
| Provider (`apps get`) | `integration` rows counted |
|
|
665
|
+
| --- | --- |
|
|
666
|
+
| `open_revenue` | `app_store_connect`, `google_play`, `stripe` |
|
|
667
|
+
| `revenue_cat` | `revenue_cat`, `stripe` |
|
|
668
|
+
| none chosen | every integration |
|
|
669
|
+
|
|
670
|
+
Rows with `source = 'sdk'` always count, and RevenueCat's copies of Stripe
|
|
671
|
+
purchases never do. `superwall query --app <id>` passes the app's list as
|
|
672
|
+
`{revenue_integrations:Array(String)}` (and the id as `{app:UInt64}`), so write
|
|
673
|
+
the filter once and let the CLI fill it:
|
|
674
|
+
|
|
675
|
+
```sql
|
|
676
|
+
WHERE applicationId = {app:UInt64}
|
|
677
|
+
AND (integration IN {revenue_integrations:Array(String)} OR source = 'sdk')
|
|
678
|
+
AND NOT (coalesce(integration, '') = 'revenue_cat' AND store = 'STRIPE')
|
|
679
|
+
```
|
|
680
|
+
|
|
649
681
|
##### Attribution
|
|
650
682
|
|
|
651
683
|
- **attributionEventId**: Non-empty when the revenue event is attributed to a Superwall paywall presentation
|
|
@@ -687,7 +719,7 @@ name = 'billing_issue' AND lower(periodType) = 'trial' -- Trial billing iss
|
|
|
687
719
|
|
|
688
720
|
#### Dedup Pattern for Revenue
|
|
689
721
|
|
|
690
|
-
Events can arrive from multiple sources (SDK + RevenueCat + App Store Connect).
|
|
722
|
+
Events can arrive from multiple sources (SDK + RevenueCat + App Store Connect). Filter by the app's revenue provider (above), then dedup by `(applicationId, name, originalTransactionId, transactionId, attributed)`:
|
|
691
723
|
|
|
692
724
|
```sql
|
|
693
725
|
SELECT applicationId, attributed,
|
|
@@ -701,7 +733,9 @@ FROM (
|
|
|
701
733
|
attributionEventId != '' as attributed,
|
|
702
734
|
argMax(price, ts) AS price
|
|
703
735
|
FROM open_revenue.attributed_events_by_ts_rep FINAL
|
|
704
|
-
WHERE isSandbox = 0 AND applicationId = {
|
|
736
|
+
WHERE isSandbox = 0 AND applicationId = {app:UInt64}
|
|
737
|
+
AND (integration IN {revenue_integrations:Array(String)} OR source = 'sdk')
|
|
738
|
+
AND NOT (coalesce(integration, '') = 'revenue_cat' AND store = 'STRIPE')
|
|
705
739
|
AND ts >= now() - INTERVAL 90 DAY AND ts < now()
|
|
706
740
|
AND isFamilyShare = 0
|
|
707
741
|
GROUP BY applicationId, name, originalTransactionId, transactionId, attributed
|
|
@@ -724,7 +758,7 @@ WITH opens AS (
|
|
|
724
758
|
CASE WHEN breakdown['paywallId'] IN ('id1','id2') THEN 'a' ELSE 'b' END as seg,
|
|
725
759
|
uniqIfMerge(vendorIds) as open_users
|
|
726
760
|
FROM open_revenue.sdk_events_agg
|
|
727
|
-
WHERE applicationId = {
|
|
761
|
+
WHERE applicationId = {app:UInt64} AND isSandbox = 0
|
|
728
762
|
AND name = 'paywall_open' AND tsType = 'event_time'
|
|
729
763
|
AND ts >= now() - INTERVAL 45 DAY AND ts < now()
|
|
730
764
|
GROUP BY day, seg
|
|
@@ -792,7 +826,7 @@ SELECT paywallId, placement, experimentId, variantId,
|
|
|
792
826
|
uniqMerge(users_state) as unique_users,
|
|
793
827
|
uniqMerge(views_state) as total_views
|
|
794
828
|
FROM open_revenue.paywall_open_events_agg
|
|
795
|
-
WHERE applicationId = {
|
|
829
|
+
WHERE applicationId = {app:UInt64} AND environment = 'PRODUCTION'
|
|
796
830
|
GROUP BY paywallId, placement, experimentId, variantId
|
|
797
831
|
ORDER BY unique_users DESC LIMIT 20
|
|
798
832
|
```
|
|
@@ -803,7 +837,7 @@ SELECT variantId,
|
|
|
803
837
|
uniqMerge(users_state) as unique_users,
|
|
804
838
|
uniqMerge(views_state) as total_views
|
|
805
839
|
FROM open_revenue.paywall_open_events_agg
|
|
806
|
-
WHERE applicationId = {
|
|
840
|
+
WHERE applicationId = {app:UInt64} AND environment = 'PRODUCTION'
|
|
807
841
|
AND experimentId = {exp_id}
|
|
808
842
|
GROUP BY variantId ORDER BY variantId
|
|
809
843
|
```
|
|
@@ -812,13 +846,12 @@ GROUP BY variantId ORDER BY variantId
|
|
|
812
846
|
|
|
813
847
|
# Related Tables (Not Documented Here But Referenced)
|
|
814
848
|
|
|
815
|
-
| Table
|
|
816
|
-
|
|
|
817
|
-
| `
|
|
818
|
-
| `open_revenue.
|
|
819
|
-
| `
|
|
820
|
-
| `sw.
|
|
821
|
-
| `sw.user_aliases_rep` | User ID to alias mappings (use FINAL, filter isDeleted=0) |
|
|
849
|
+
| Table | Purpose |
|
|
850
|
+
| ------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
|
|
851
|
+
| `open_revenue.attributed_events_by_experiment_rep_next` | Revenue by A/B experiment (use FINAL) |
|
|
852
|
+
| `open_revenue.sdk_events_agg` | Pre-aggregated SDK events - prefer over `events_rep` for counts/uniques. Uses AggregateFunction columns. |
|
|
853
|
+
| `sw.device_attributes_rep` | Device-level attributes (use FINAL, filter isDeleted=0) |
|
|
854
|
+
| `sw.user_aliases_rep` | User ID to alias mappings (use FINAL, filter isDeleted=0) |
|
|
822
855
|
|
|
823
856
|
#### `open_revenue.sdk_events_agg` Quick Reference
|
|
824
857
|
|
|
@@ -838,7 +871,7 @@ Pre-aggregated SDK events. Much faster than raw tables for counts/uniques.
|
|
|
838
871
|
-- Weekly installs
|
|
839
872
|
SELECT toStartOfWeek(ts, 1) as week, uniqIfMerge(vendorIds) as installs
|
|
840
873
|
FROM open_revenue.sdk_events_agg
|
|
841
|
-
WHERE applicationId = {
|
|
874
|
+
WHERE applicationId = {app:UInt64} AND isSandbox = 0
|
|
842
875
|
AND name = 'first_seen' AND tsType = 'install_time'
|
|
843
876
|
AND ts >= now() - INTERVAL 90 DAY AND ts < now()
|
|
844
877
|
GROUP BY week ORDER BY week
|
|
@@ -861,7 +894,7 @@ sw.applications_rep (applicationId)
|
|
|
861
894
|
|
|
862
895
|
#### Finding an Application
|
|
863
896
|
|
|
864
|
-
1. Search `
|
|
897
|
+
1. Search `sw.applications_rep` by name
|
|
865
898
|
2. If multiple results, check `sw.events_hr_agg` for recent event counts
|
|
866
899
|
3. Show `applicationId` + link: `superwall.com/applications/:applicationId`
|
|
867
900
|
|
|
@@ -33,14 +33,14 @@ placement (in code) → campaign (routes it) → audience (who) → paywal
|
|
|
33
33
|
2. **Find registered placements.** Grep the app for `register(`, `registerPlacement(`,
|
|
34
34
|
`usePlacement(`, `Superwall.shared.register` - collect the exact event-name strings.
|
|
35
35
|
3. **Ensure an entitlement.** `superwall entitlements list --project <id> --json`; reuse an existing one, else
|
|
36
|
-
`superwall entitlements create pro --project <id> --json`. Default to a single `pro` entitlement unless the
|
|
36
|
+
`superwall entitlements create --identifier pro --project <id> --json`. Default to a single `pro` entitlement unless the
|
|
37
37
|
app clearly has tiers.
|
|
38
38
|
4. **Ensure products.** `superwall products list --project <id> --json` first. If none:
|
|
39
39
|
- App Store Connect connected (`superwall asc keys list --json`) → import (see `setup.md` beside this file).
|
|
40
40
|
- Otherwise create with real pricing:
|
|
41
|
-
`superwall products create pro_yearly --price 39.99 --period year --trial-days 7 --entitlement pro --project <id> --json`
|
|
41
|
+
`superwall products create --identifier pro_yearly --price 39.99 --period year --trial-days 7 --entitlement pro --project <id> --json`
|
|
42
42
|
5. **Carry each placement.** `superwall campaigns list --project <id> --app <id> --json`. For each placement not already on
|
|
43
|
-
a campaign: `superwall campaigns create "<description>" <placement> --project <id> --app <id> --json` (campaigns require an initial placement; it seeds a 100% holdout audience), or add more with `superwall campaigns
|
|
43
|
+
a campaign: `superwall campaigns create --description "<description>" --placement <placement> --project <id> --app <id> --json` (campaigns require an initial placement; it seeds a 100% holdout audience), or add more with `superwall campaigns placements create <campaignId> --event-name <placement> --project <id> --app <id> --json`.
|
|
44
44
|
|
|
45
45
|
## Guardrails
|
|
46
46
|
|
|
@@ -18,7 +18,7 @@ single app the CLI auto-scopes; agents always pass the flags explicitly.
|
|
|
18
18
|
### Create by hand (real pricing)
|
|
19
19
|
|
|
20
20
|
```bash
|
|
21
|
-
superwall products create <identifier> \
|
|
21
|
+
superwall products create --identifier <identifier> \
|
|
22
22
|
--price 39.99 \ # major units; converted to cents for you
|
|
23
23
|
--currency USD \ # default USD
|
|
24
24
|
--period year \ # day | week | month | year
|
|
@@ -39,7 +39,7 @@ There is **no** `products import` subcommand. `superwall integrate --skill`
|
|
|
39
39
|
prints the full setup instructions without spawning another agent. To import
|
|
40
40
|
products yourself, use credentials the user has already connected privately,
|
|
41
41
|
enumerate via the signed ASC proxy, then create products in the approved scope.
|
|
42
|
-
If credentials are missing, have the user consult `superwall asc keys
|
|
42
|
+
If credentials are missing, have the user consult `superwall asc keys create --help`
|
|
43
43
|
at their own terminal and complete setup themselves. Do not request, inspect,
|
|
44
44
|
or upload their private key.
|
|
45
45
|
|
|
@@ -47,13 +47,13 @@ or upload their private key.
|
|
|
47
47
|
superwall asc keys list --json # confirm connected; note the team id
|
|
48
48
|
|
|
49
49
|
# enumerate real products for the app (by bundle id or ASC app id)
|
|
50
|
-
superwall asc subscriptions com.app.bundle --json # renewing subs
|
|
51
|
-
superwall asc iaps com.app.bundle --json # one-time / non-renewing
|
|
50
|
+
superwall asc subscriptions list com.app.bundle --json # renewing subs
|
|
51
|
+
superwall asc iaps list com.app.bundle --json # one-time / non-renewing
|
|
52
52
|
superwall asc products com.app.bundle --json # everything
|
|
53
53
|
superwall asc apps --json # list ASC apps if unsure of the id
|
|
54
54
|
|
|
55
55
|
# create each returned productId, granting your entitlement
|
|
56
|
-
superwall products create com.app.pro.yearly --entitlement pro --project <id> --json
|
|
56
|
+
superwall products create --identifier com.app.pro.yearly --entitlement pro --project <id> --json
|
|
57
57
|
```
|
|
58
58
|
|
|
59
59
|
Products imported this way carry only the identifier (and reference name); Xcode/StoreKit and
|
|
@@ -71,7 +71,7 @@ Seeds product identifiers into a StoreKit configuration file; Xcode refines pric
|
|
|
71
71
|
|
|
72
72
|
```bash
|
|
73
73
|
superwall entitlements list --project <id> --json
|
|
74
|
-
superwall entitlements create pro --project <id> --json
|
|
74
|
+
superwall entitlements create --identifier pro --project <id> --json
|
|
75
75
|
```
|
|
76
76
|
|
|
77
77
|
Default to a single coarse `pro` entitlement. Add more only for genuine tiers (e.g. `pro`,
|
|
@@ -81,8 +81,8 @@ Default to a single coarse `pro` entitlement. Add more only for genuine tiers (e
|
|
|
81
81
|
|
|
82
82
|
```bash
|
|
83
83
|
superwall campaigns list --project <id> --app <id> --json
|
|
84
|
-
superwall campaigns create "Onboarding" onboarding_complete --project <id> --app <id> --json
|
|
85
|
-
superwall campaigns
|
|
84
|
+
superwall campaigns create --description "Onboarding" --placement onboarding_complete --project <id> --app <id> --json
|
|
85
|
+
superwall campaigns placements create <campaignId> --event-name another_placement --project <id> --app <id> --json
|
|
86
86
|
```
|
|
87
87
|
|
|
88
88
|
- `create` takes a **description**, not an identifier - name it for the surface.
|
|
@@ -119,14 +119,14 @@ Produce: product ids, access-level ids (→ entitlements), and one row per `getP
|
|
|
119
119
|
## 4. Dashboard-side re-creation (CLI)
|
|
120
120
|
|
|
121
121
|
```bash
|
|
122
|
-
superwall entitlements create premium --project <projectId> --json
|
|
123
|
-
superwall products create com.app.premium_monthly --name "Premium Monthly" --project <projectId> --json
|
|
124
|
-
superwall products create com.app.premium_yearly --name "Premium Yearly" --project <projectId> --json
|
|
125
|
-
superwall campaigns create "Main paywall" main --project <projectId> --app <appId> --json
|
|
126
|
-
superwall campaigns
|
|
122
|
+
superwall entitlements create --identifier premium --project <projectId> --json
|
|
123
|
+
superwall products create --identifier com.app.premium_monthly --name "Premium Monthly" --project <projectId> --json
|
|
124
|
+
superwall products create --identifier com.app.premium_yearly --name "Premium Yearly" --project <projectId> --json
|
|
125
|
+
superwall campaigns create --description "Main paywall" --placement main --project <projectId> --app <appId> --json
|
|
126
|
+
superwall campaigns placements create <campaignId> --event-name onboarding --project <projectId> --app <appId> --json
|
|
127
127
|
```
|
|
128
128
|
|
|
129
|
-
Product ids MUST equal existing App Store / Play SKUs (import from ASC via `superwall asc keys
|
|
129
|
+
Product ids MUST equal existing App Store / Play SKUs (import from ASC via `superwall asc keys create --help`).
|
|
130
130
|
Verify with the same explicit ids: `superwall entitlements list --project <projectId> --json`,
|
|
131
131
|
`superwall products list --project <projectId> --json`, and `superwall campaigns list --project <projectId> --app <appId> --json`.
|
|
132
132
|
|
|
@@ -69,10 +69,10 @@ Agents always use `--json` and explicit scope:
|
|
|
69
69
|
superwall whoami --json
|
|
70
70
|
superwall apps list --json
|
|
71
71
|
superwall entitlements list --project <projectId> --json
|
|
72
|
-
superwall entitlements create <id> --project <projectId> --json
|
|
72
|
+
superwall entitlements create --identifier <id> --project <projectId> --json
|
|
73
73
|
superwall products list --project <projectId> --json
|
|
74
|
-
superwall products create <storeId> --project <projectId> --json
|
|
74
|
+
superwall products create --identifier <storeId> --project <projectId> --json
|
|
75
75
|
superwall campaigns list --project <projectId> --app <appId> --json
|
|
76
|
-
superwall campaigns create "<description>" <placement> --project <projectId> --app <appId> --json
|
|
77
|
-
superwall campaigns
|
|
76
|
+
superwall campaigns create --description "<description>" --placement <placement> --project <projectId> --app <appId> --json
|
|
77
|
+
superwall campaigns placements create <campaignId> --event-name <placement> --project <projectId> --app <appId> --json
|
|
78
78
|
```
|
|
@@ -116,13 +116,13 @@ Produce: product ids, entitlement/permission ids (→ entitlements), and one row
|
|
|
116
116
|
## 4. Dashboard-side re-creation (CLI)
|
|
117
117
|
|
|
118
118
|
```bash
|
|
119
|
-
superwall entitlements create premium --project <projectId> --json
|
|
120
|
-
superwall products create com.app.premium_monthly --name "Premium Monthly" --project <projectId> --json
|
|
121
|
-
superwall products create com.app.premium_yearly --name "Premium Yearly" --project <projectId> --json
|
|
122
|
-
superwall campaigns create "Main paywall" paywall_main --project <projectId> --app <appId> --json
|
|
119
|
+
superwall entitlements create --identifier premium --project <projectId> --json
|
|
120
|
+
superwall products create --identifier com.app.premium_monthly --name "Premium Monthly" --project <projectId> --json
|
|
121
|
+
superwall products create --identifier com.app.premium_yearly --name "Premium Yearly" --project <projectId> --json
|
|
122
|
+
superwall campaigns create --description "Main paywall" --placement paywall_main --project <projectId> --app <appId> --json
|
|
123
123
|
```
|
|
124
124
|
|
|
125
|
-
Product ids MUST equal existing App Store / Play SKUs (import from ASC via `superwall asc keys
|
|
125
|
+
Product ids MUST equal existing App Store / Play SKUs (import from ASC via `superwall asc keys create --help`).
|
|
126
126
|
Verify with the same explicit ids: `superwall entitlements list --project <projectId> --json`,
|
|
127
127
|
`superwall products list --project <projectId> --json`, and `superwall campaigns list --project <projectId> --app <appId> --json`.
|
|
128
128
|
|
|
@@ -203,18 +203,18 @@ call the migration complete with dashboard work silently skipped.
|
|
|
203
203
|
For each entitlement and product found, use the project/app ids from the account gate:
|
|
204
204
|
|
|
205
205
|
```bash
|
|
206
|
-
superwall entitlements create pro --project <projectId> --json
|
|
207
|
-
superwall products create com.app.pro_monthly --name "Pro Monthly" --project <projectId> --json
|
|
208
|
-
superwall products create com.app.pro_yearly --name "Pro Yearly" --project <projectId> --json
|
|
206
|
+
superwall entitlements create --identifier pro --project <projectId> --json
|
|
207
|
+
superwall products create --identifier com.app.pro_monthly --name "Pro Monthly" --project <projectId> --json
|
|
208
|
+
superwall products create --identifier com.app.pro_yearly --name "Pro Yearly" --project <projectId> --json
|
|
209
209
|
```
|
|
210
210
|
|
|
211
211
|
Product ids MUST equal the existing App Store / Play SKUs (import via ASC connection instead of
|
|
212
|
-
manual create when possible - `superwall asc keys
|
|
212
|
+
manual create when possible - `superwall asc keys create --help`). Then one campaign with
|
|
213
213
|
a placement per call site:
|
|
214
214
|
|
|
215
215
|
```bash
|
|
216
|
-
superwall campaigns create "Main paywall" start_workout --project <projectId> --app <appId> --json
|
|
217
|
-
superwall campaigns
|
|
216
|
+
superwall campaigns create --description "Main paywall" --placement start_workout --project <projectId> --app <appId> --json
|
|
217
|
+
superwall campaigns placements create <campaignId> --event-name unlock_export --project <projectId> --app <appId> --json
|
|
218
218
|
```
|
|
219
219
|
|
|
220
220
|
Verify with the same explicit ids: `superwall entitlements list --project <projectId> --json`,
|
|
@@ -147,8 +147,8 @@ 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 "Editor upgrade paywall" unlock_export --project <id> --app <id> --json
|
|
151
|
-
superwall campaigns
|
|
150
|
+
superwall campaigns create --description "Editor upgrade paywall" --placement unlock_export --project <id> --app <id> --json
|
|
151
|
+
superwall campaigns placements create <campaignId> --event-name another_placement --project <id> --app <id> --json
|
|
152
152
|
```
|
|
153
153
|
|
|
154
154
|
## Pitfalls
|
|
@@ -131,8 +131,8 @@ 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 "Editor upgrade paywall" unlock_export --project <id> --app <id> --json
|
|
135
|
-
superwall campaigns
|
|
134
|
+
superwall campaigns create --description "Editor upgrade paywall" --placement unlock_export --project <id> --app <id> --json
|
|
135
|
+
superwall campaigns placements create <campaignId> --event-name another_placement --project <id> --app <id> --json
|
|
136
136
|
```
|
|
137
137
|
|
|
138
138
|
## Pitfalls
|
|
@@ -113,8 +113,8 @@ ElevatedButton(
|
|
|
113
113
|
|
|
114
114
|
```bash
|
|
115
115
|
superwall campaigns list --project <id> --app <id> --json
|
|
116
|
-
superwall campaigns create "Editor upgrade paywall" unlock_export --project <id> --app <id> --json
|
|
117
|
-
superwall campaigns
|
|
116
|
+
superwall campaigns create --description "Editor upgrade paywall" --placement unlock_export --project <id> --app <id> --json
|
|
117
|
+
superwall campaigns placements create <campaignId> --event-name another_placement --project <id> --app <id> --json
|
|
118
118
|
```
|
|
119
119
|
|
|
120
120
|
## Pitfalls
|
|
@@ -140,8 +140,8 @@ 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 "Editor upgrade paywall" unlock_export --project <id> --app <id> --json
|
|
144
|
-
superwall campaigns
|
|
143
|
+
superwall campaigns create --description "Editor upgrade paywall" --placement unlock_export --project <id> --app <id> --json
|
|
144
|
+
superwall campaigns placements create <campaignId> --event-name another_placement --project <id> --app <id> --json
|
|
145
145
|
```
|
|
146
146
|
|
|
147
147
|
## Pitfalls
|
|
@@ -46,8 +46,8 @@ 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>" <placement_name> --project <id> --app <id> --json` - create one with its required first placement.
|
|
50
|
-
- `superwall campaigns
|
|
49
|
+
- `superwall campaigns create --description "<description>" --placement <placement_name> --project <id> --app <id> --json` - create one with its required first placement.
|
|
50
|
+
- `superwall campaigns placements create <campaignId> --event-name <placement_name> --project <id> --app <id> --json` - route another placement.
|
|
51
51
|
|
|
52
52
|
Analytics-only, future, and paused placements may intentionally remain unrouted.
|
|
53
53
|
For placements expected to present now, use one campaign per distinct paywall
|
|
@@ -116,8 +116,8 @@ 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 "Editor upgrade paywall" unlock_export --project <id> --app <id> --json
|
|
120
|
-
superwall campaigns
|
|
119
|
+
superwall campaigns create --description "Editor upgrade paywall" --placement unlock_export --project <id> --app <id> --json
|
|
120
|
+
superwall campaigns placements create <campaignId> --event-name another_placement --project <id> --app <id> --json
|
|
121
121
|
```
|
|
122
122
|
|
|
123
123
|
## Pitfalls
|
|
@@ -213,8 +213,8 @@ 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 "Editor upgrade paywall" unlock_export --project <id> --app <id> --json
|
|
217
|
-
superwall campaigns
|
|
216
|
+
superwall campaigns create --description "Editor upgrade paywall" --placement unlock_export --project <id> --app <id> --json
|
|
217
|
+
superwall campaigns placements create <campaignId> --event-name another_placement --project <id> --app <id> --json
|
|
218
218
|
```
|
|
219
219
|
|
|
220
220
|
Rule of thumb: one campaign per distinct paywall surface/decision (onboarding,
|
|
@@ -50,7 +50,7 @@ project/app ids and pass them to `superwall products list --project <id> --json`
|
|
|
50
50
|
`superwall entitlements list --project <id> --json`, `superwall campaigns list
|
|
51
51
|
--project <id> --app <id> --json`, and `superwall paywalls list --project <id>
|
|
52
52
|
--app <id> --json`. When App Store Connect is linked,
|
|
53
|
-
use `superwall asc subscriptions <bundle-id> --json` to compare store identifiers.
|
|
53
|
+
use `superwall asc subscriptions list <bundle-id> --json` to compare store identifiers.
|
|
54
54
|
|
|
55
55
|
## Framework reference
|
|
56
56
|
|
|
@@ -15,10 +15,10 @@ description: LEGACY — drives the browser (visual) paywall editor over a pairin
|
|
|
15
15
|
> `superwall-framework` skill. If it isn't installed:
|
|
16
16
|
>
|
|
17
17
|
> ```bash
|
|
18
|
-
> npx skills add https://github.com/superwall/skills
|
|
18
|
+
> npx skills add https://github.com/superwall/skills --skill superwall-framework --global --yes --agent claude-code universal --full-depth
|
|
19
19
|
> ```
|
|
20
20
|
>
|
|
21
|
-
> The framework is
|
|
21
|
+
> The framework is in public beta: for now the CLI has its commands only
|
|
22
22
|
> while `SUPERWALL_CHANNEL=next` is set (an `Unknown command: create` means
|
|
23
23
|
> it is missing; ask the user to set it in their shell rc and relaunch).
|
|
24
24
|
>
|
package/dist/tools.d.ts
CHANGED