adapty-flow-automation
Automate Adapty Flows (v4 Beta) and paywall/placement config that the official CLI and public API can't reach - flow authoring, publishing, flow-type placements - by driving Adapty's internal dashboard "portal" API with a headless-capable bearer token. Use when the user wants to script Adapty flow create/edit/publish, wire flow placements, treat a flow as versioned code, verify a flow actually went live, or asks why an Adapty v4 flow renders the native fallback instead of the remote flow.
- License 许可
- MIT
- 所属仓库
- Necmttn/skills
- 最近更新
- 2026-11-07
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- adapty-flow-automation
- description
- Automate Adapty Flows (v4 Beta) and paywall/placement config that the official CLI and public API can't reach - flow authoring, publishing, flow-type placements - by driving Adapty's internal dashboard "portal" API with a headless-capable bearer token. Use when the user wants to script Adapty flow create/edit/publish, wire flow placements, treat a flow as versioned code, verify a flow actually went live, or asks why an Adapty v4 flow renders the native fallback instead of the remote flow.
02 资源文件 2
- 参考文档flow-gotchas.md3.3 KB
- 参考文档portal-api.md5.8 KB
03 SKILL.md 正文
Automating Adapty Flows
Adapty has three API surfaces plus one undocumented internal one. Flows (v4 Beta) live only in the internal one. Pick the surface by task; don't reach for the browser when a real API covers it.
| Surface | Base / Auth | Covers | Spec |
|---|---|---|---|
| Server-side v2 | api.adapty.io / Api-Key <secret> |
profiles, grant access level (Rescue-Pass leaf), transactions, analytics export | Postman collection |
| Developer (CLI) | api-admin.adapty.io/api/v1/developer / oauth bearer |
apps, products, paywalls, paywall-type placements, access-levels, segments (read-only) | none published; zod schemas in adapty npm pkg dist/lib/api-schemas.js |
| SDK read | api.adapty.io/api/v1/sdk/... / Api-Key <public> |
placement variation fetch - publish verification | undocumented, stable |
| Portal (internal) | api-admin.adapty.io/api/v1/portal/{app_id}/ / dashboard bearer |
flows author + publish, flow-type placements, everything the builder does | none - sniffed, fragile |
Full portal endpoint map + request shapes: portal-api.md. The four gotchas that make a v4 flow silently fall back to native: flow-gotchas.md.
Decision: which surface
- Grant/revoke entitlement, profile ops → server-side v2 (secret key). Documented, stable, safe for backend.
- Products, paywalls, paywall-type placements CRUD → developer API via
bunx adaptyCLI (adapty auth loginonce). No flows here. - Flow create/edit/publish, flow-type placements → portal API (this skill's core). Nothing official reaches these.
- "Did my flow actually go live?" → SDK read endpoint, always. See Verify below.
Portal auth (the unlock)
The dashboard authenticates portal calls with a bearer token in localStorage, not a cookie - so once extracted it works fully headless (credentials: 'omit' returns 200). The CLI's oauth token is a different realm and 401s on portal.
Extract once per session, from a logged-in app.adapty.io tab:
localStorage.getItem('adapty/token') // 40-char opaque string
Then every portal call:
Authorization: Bearer <token>
Token is session-scoped (a fox_auth_timestamp refresh mechanism exists); expect to re-extract when calls start 401ing.
Flow-as-code pipeline
The entire flow - screens, elements, props, product bindings, triggers - is one JSON document at GET/PUT in-apps/flows/{flow_id}/config/, guarded by an optimistic-lock field expected_updated_at.
- Pull
GET .../config/→ commit the JSON to the repo. The flow is now a versioned artifact. - Edit locally (copy tweaks, product ids, A/B variants), keep
expected_updated_atfrom the last GET. - Push
PUT .../config/. - Publish
POST in-apps/flows/{flow_id}/publish/(empty body). This is the step the builder hides behind a confirmation modal - miss it and the draft never goes live while the UI reads "Changes saved". - Verify (below). Never trust the publish response alone.
Verify a flow is live (do this after EVERY mutation)
Hit the public SDK read endpoint with the app's public key:
GET https://api.adapty.io/api/v1/sdk/in-apps/{public_key}/flow/variations/{placement_id}/{profile_hash}/
Authorization: Api-Key {public_key}.{public_secret}
adapty-sdk-version: 4.0.0
flow_version_idmust change after a publish.variationsarray must be non-empty. Empty ⇒ the SDK maps it to zeroflow.paywalls⇒getPaywallProductsthrowsnoProductIDsFound⇒ the app silently renders its native fallback. This is the single most common "why isn't my flow showing" cause.
Poll it in a loop after publish; CDN propagation is a few seconds.
Safety
- Portal API is unofficial - Adapty can change request shapes on any dashboard release. Pin exact shapes, re-sniff if calls break (open app.adapty.io, DevTools → Network, filter
api-admin, or re-run the fetch-hook in portal-api.md). - Always run the SDK-endpoint verify after a portal mutation. Treat a green publish response as unproven until
variationsis non-empty. - Flow placements on a live SDK key affect real users the moment they publish. On an unreleased app that's harmless; before launch, repoint/delete test placements.
04 同仓库更多 Skills
wiki
Recall from the personal LLM wiki at ~/wiki. Use when the user asks what the wiki says, wants prior thinking/intuition on a concept, or when grounding a design or decision in previously synthesized knowledge. Read-only - never writes to the wiki.
wiki-ingest
Curate a source into the personal LLM wiki at ~/wiki following its SCHEMA.md - a file, URL, research output, ax session, or a pending ~/wiki/inbox/ brief. Use when the user says "add this to the wiki", "ingest this", "promote the inbox", or after research worth keeping long-term.
wiki-harvest
Propose-only sweep of recent coding sessions (via the ax CLI) for recurring concepts that are missing from, or should update, the personal LLM wiki at ~/wiki. Writes candidate briefs to ~/wiki/inbox/ only - never wiki pages. Use on schedule or when the user asks "harvest the wiki" or "what concepts am I repeating".
no-ai-slop
Strip AI-slop patterns from a draft while preserving the writer's voice, or detect slop without rewriting. Use as the mandatory final pass on any copy before shipping, when the user wants a draft clearer/less AI-sounding, or when asked "is this AI slop?", "audit this writing", "does this read as AI".
aso-appstore-screenshots
Generate high-converting App Store screenshots by analyzing your app's codebase, discovering core benefits, and creating ASO-optimized screenshot images using Nano Banana Pro.
app-idea
Run a new or existing consumer/AI app idea through the golden-track playbook (~/wiki/playbook/apps.md) from intake to verdict, write a verdict card, stop for the owner, and ratchet owner overrides back into the doctrine. Use when the user shares an app idea, asks "should I build X", "audit <app>", "re-score <app>", or pastes an idea in a product context. Never builds; never promotes a rule on its own.