.agents/skills/recur-quickstart/SKILL.md
Quick setup guide for Recur payment integration. Use when starting a new Recur integration, setting up API keys, installing the SDK, or when user mentions "integrate Recur", "setup Recur", "Recur 串接", "金流設定".
npx skillsauth add flsteven87/three_kingdoms_strategy recur-quickstartInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are helping a developer integrate Recur, Taiwan's subscription payment platform (similar to Stripe Billing).
This project uses FastAPI (Python) + React (TypeScript). All examples match this stack.
npm install recur-tw
No SDK needed — use httpx for API calls and hmac for webhook verification (both already available).
API keys are available in the Recur dashboard at app.recur.tw → Settings → Developers.
Key formats:
pk_test_xxx - Publishable key (frontend, safe to expose)sk_test_xxx - Secret key (backend only, never expose)pk_live_xxx / sk_live_xxx - Production keysEnvironment variables to set:
Frontend (.env / Zeabur):
VITE_RECUR_PUBLISHABLE_KEY=pk_test_xxx
Backend (.env / Zeabur):
RECUR_SECRET_KEY=sk_test_xxx
RECUR_WEBHOOK_SECRET=whsec_xxx
Note:
VITE_*vars are build-time — frontend needs rebuild after changes.
Wrap your app with RecurProvider:
import { RecurProvider } from 'recur-tw'
function App({ children }: { children: React.ReactNode }) {
return (
<RecurProvider
config={{
publishableKey: import.meta.env.VITE_RECUR_PUBLISHABLE_KEY,
}}
>
{children}
</RecurProvider>
)
}
# src/core/config.py — add to Settings class
class Settings(BaseSettings):
recur_secret_key: str = ""
recur_webhook_secret: str = ""
import { useRecur } from 'recur-tw'
function PricingButton({ productId }: { productId: string }) {
const { checkout, isLoading } = useRecur()
const handleCheckout = async () => {
await checkout({
productId,
customerEmail: user.email, // Pre-fill from auth
externalCustomerId: user.id, // Link to your user system
onPaymentComplete: (result) => {
console.log('Payment successful!', result)
},
onPaymentFailed: (error) => {
console.error('Payment failed:', error)
return { action: 'retry' }
},
})
}
return (
<button onClick={handleCheckout} disabled={isLoading}>
{isLoading ? '處理中...' : '訂閱'}
</button>
)
}
See /recur-webhooks for FastAPI webhook handler with signature verification.
recur-tw installed (npm list recur-tw)VITE_RECUR_PUBLISHABLE_KEY, backend RECUR_SECRET_KEY + RECUR_WEBHOOK_SECRET)RecurProvider wrapping apppk_test_* key)| Environment | Limit | |------------|-------| | Sandbox | 120 req/min | | Production | 600 req/min |
Response headers: X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
pk_test_, sk_test_, pk_live_, or sk_live_pk_*), backend uses secret key (sk_*)RecurProvider wraps your appVITE_RECUR_PUBLISHABLE_KEY is set (requires rebuild)/recur-checkout - Learn checkout flow options (modal, embedded, redirect)/recur-webhooks - Set up FastAPI webhook handler/recur-entitlements - Implement access control/recur-portal - Customer self-service portal| 月營收 | 平台手續費 | |-------|----------| | < NT$100,000 | 免費 | | ≥ NT$100,000 | 2.4% (低於市場 2.8%) |
支付處理商:PAYUNi(台灣信用卡)
development
Set up and handle Recur webhook events for payment notifications. Use when implementing webhook handlers, verifying signatures, handling subscription events, or when user mentions "webhook", "付款通知", "訂閱事件", "payment notification".
development
Implement Customer Portal for subscription self-service. Use when building account pages, letting customers manage subscriptions, update payment methods, view billing history, or when user mentions "customer portal", "帳戶管理", "訂閱管理", "更新付款方式", "self-service".
data-ai
List all available Recur skills and how to use them. Use when user asks "what can Recur do", "Recur skills", "Recur 有什麼功能", "help with Recur", "如何使用 Recur skills".
development
Implement access control and permission checking with Recur entitlements API. Use when building paywalls, checking subscription status, gating premium features, or when user mentions "paywall", "權限檢查", "entitlements", "access control", "premium features".