whop-app-integration
1
总安装量
1
周安装量
#53060
全站排名
安装命令
npx skills add https://github.com/jpkovas/whop-app-integration --skill whop-app-integration
Agent 安装分布
amp
1
opencode
1
cursor
1
kimi-cli
1
codex
1
github-copilot
1
Skill 文档
Whop App Integration
Overview
Implement Whop licensing using a backend-first architecture, then connect app activation UX, periodic revalidation, and webhook-driven entitlement sync.
Required Architecture
- Keep Whop API keys only on backend services.
- Route requests as
app -> backend -> Whop API. - Process Whop webhooks on backend and persist entitlement state locally.
- Reject client-only designs that send
Authorization: BearerWhop keys from app code.
Workflow
- Define entitlement policy before coding
- Choose plan model: subscription or perpetual.
- Define device policy: one device, up to N devices, or manual transfer.
- Define offline grace policy and revocation timing.
- Persist these as explicit backend config.
- Configure Whop assets
- Configure product and plans; confirm each
purchase_url. - Create API key with minimum scopes required by the chosen endpoints.
- Configure webhook endpoint and secret.
- Enable at least:
membership.activated,membership.deactivated,membership.cancel_at_period_end_changed.
- Implement backend contract
- Implement
POST /api/license/activatethat receives license input andhwid, then calls Whop license validation. - Implement
POST /api/webhooks/whopand verify signature before processing payload. - Store entitlements keyed by Whop membership id and user id.
- Make webhook handling idempotent.
- Implement app activation
- Build input UI for license key and loading/error states.
- Send activation requests only to backend endpoints.
- Store only activation status, timestamps, and non-secret metadata in app storage.
- Present user-safe messages for invalid license, conflict, and connectivity failures.
- Implement periodic validation
- Revalidate on launch and on time interval (for example every 24h).
- Reuse the same metadata strategy used during activation.
- If offline, apply a bounded grace window before disabling paid access.
- Implement cancellation and revocation sync
- Revoke local entitlement on
membership.deactivated. - Update renewal state on cancel-at-period-end changes.
- Treat webhook events as source of truth for passive status changes.
- Complete release checks
- Test activation success, mismatch, and not-found cases.
- Test webhook signature pass/fail handling.
- Test transfer/reset behavior if supported by product policy.
- Test offline grace expiration behavior.
Implementation Rules
- Read
references/implementation-playbook.mdfor endpoint matrix, payloads, and error mappings. - Read
references/platform-recipes.mdfor Node, Python, and Swift implementation recipes. - Use
scripts/verify_whop_webhook.pyto test signature verification with captured payloads. - Prefer current official Whop docs when endpoint versions differ from existing code.
- Keep structured logs with request id, membership id, event type, HTTP status, and API error body.
Output Requirements
When using this skill in a task:
- Deliver backend route(s), webhook handler(s), and app activation flow updates.
- Add or update automated tests for activation, webhook verification, and revocation.
- Document security-sensitive implementation choices in changed files.
- Return a checklist that separates completed items from pending items.