rc-webhooks
БесплатноБез исполняемых скриптовНе проверенUse this skill when consuming RevenueCat webhooks on your backend. Covers authenticating requests (Authorization header, optional HMAC signing), parsing the…
от RevenueCat★ 80 звёзд на GitHubОб этом скилле
RevenueCat Webhooks
You configure one endpoint. RevenueCat posts one normalized JSON event schema for every store. Your job on the server side is to authenticate the request, deduplicate by event.id, and update your records from the customer the event touches.
Phase 1: Discover
Confirm what you are wiring up before touching code.
- You own a server side HTTPS endpoint that accepts POST with a JSON body.
- You set an authorization header value on the webhook integration in the RevenueCat dashboard under Integrations then Webhooks. If you also turn on HMAC webhook signing there, you stored its signing secret, which the dashboard shows only once.
- Google Play Real Time Developer Notifications are connected to RevenueCat. Without them RevenueCat may learn about a refund of a one time purchase only when the app next opens.
- You have durable storage to record processed event IDs and entitlement state per user.
- You have the secret REST API key on the server, to re-read customers with
GET /v1/subscribers/{app_user_id}. - You understand that RevenueCat has already mapped products to entitlements, so the customer it returns lists every entitlement with its
expires_date, expired ones included. You do not maintain a product to entitlement table on your backend.
Every event has this outer shape:
{
"api_version": "1.0",
"event": {
"id": "evt_01HABCXYZ0000000000000001",
"type": "INITIAL_PURCHASE",
"app_user_id": "user_12345",
"original_app_user_id": "$RCAnonymousID:8b1d0e5c4f2a4d3e9c6b7a5f4e3d2c1b",
"aliases": ["$RCAnonymousID:8b1d0e5c4f2a4d3e9c6b7a5f4e3d2c1b", "user_12345"],
"product_id": "premium_monthly",
"period_type": "NORMAL",
"purchased_at_ms": 1700000000000,
"expiration_at_ms": 1702592000000,
"store": "PLAY_STORE",
"environment": "PRODUCTION",
"entitlement_ids": ["pro_access"],
"transaction_id": "GPA.1234-5678-9012-34567"
}
}
Phase 2: Plan
Take access from the customer, not from the event. For every event that can change access, re-read the customer it touches with GET /v1/subscribers/{app_user_id} and store the entitlements RevenueCat reports now. RevenueCat recommends this after any webhook, and it stays correct when events arrive late or out of order: automatic retries follow after 5, 10, 20, 40, and 80 minutes and a dashboard retry can come any time, so a retried EXPIRATION can land after the event that restored access, and another source (a granted entitlement, another store) can still grant an entitlement that one product's EXPIRATION lists. Use the payload only for what the customer does not carry, such as consumable credits.
| Event type | Meaning | Handler action besides the re-read |
|---|---|---|
INITIAL_PURCHASE |
A new subscription was purchased, including the start of a free trial (period_type TRIAL). On Google Play it is also the usual event for a resubscription after an EXPIRATION. |
Nothing. |
RENEWAL |
Subscription renewed. Some resubscriptions after an EXPIRATION arrive as RENEWAL too. |
Nothing. |
NON_RENEWING_PURCHASE |
A purchase that won't auto renew: a one time product, or an entitlement granted from the dashboard or API (store PROMOTIONAL). |
Credit consumables to the user, quantity units when present, keyed by transaction_id, except products whose balance RevenueCat in app currency manages. |
CANCELLATION |
Auto renew turned off, a billing issue was detected, a refund, or a granted entitlement was removed. cancel_reason says which. |
Do not revoke from the payload. Reverse any consumable credit recorded for the transaction_id. |
UNCANCELLATION |
User re enabled auto renew before expiry. | Nothing. |
EXPIRATION |
A subscription or a granted entitlement ended. | Nothing. The re-read normally shows the entitlement expired; trust it over entitlement_ids. |
BILLING_ISSUE |
Payment failed. User may be in grace period or on hold. | Optionally start recovery messaging, such as an email; the re-read stores billing_issues_detected_at. Do not revoke. RevenueCat sends EXPIRATION if recovery fails. |
SUBSCRIPTION_EXTENDED |
Expiry pushed back through the store API (for example a defer). On Google Play it can also mean Google deferred a renewal charge by less than 24 hours, and RENEWAL or BILLING_ISSUE follows within a day. |
Nothing. |
SUBSCRIPTION_PAUSED |
Google Play subscription scheduled to pause. auto_resume_at_ms says when it resumes. |
Nothing. Access ends later with EXPIRATION (expiration_reason SUBSCRIPTION_PAUSED). |
TEMPORARY_ENTITLEMENT_GRANT |
Short lived outage grant (up to 24h). Carries only app_user_id and sometimes store. |
Nothing; the payload has no entitlement or expiry fields. INITIAL_PURCHASE follows if the store later validates the purchase, EXPIRATION if it does not. |
PRODUCT_CHANGE |
User switched plan (upgrade, downgrade, or cross grade). | Nothing. On Google Play, new_product_id m |
Установить rc-webhooks в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл rc-webhooks?
Use this skill when consuming RevenueCat webhooks on your backend. Covers authenticating requests (Authorization header, optional HMAC signing), parsing the normalized event schema without breaking on new fields, idempotency via the event id field, every event type, and taking access from a re-read of the customer so CANCELLATION, EXPIRATION, and RENEWAL never grant or revoke the wrong access.
Как установить скилл rc-webhooks?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл rc-webhooks запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic