recur-quickstart

recur-quickstart

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 串接", "金流設定".

0星標
0分支
更新於 1/22/2026
SKILL.md
readonlyread-only
name
recur-quickstart
description

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 串接", "金流設定".

version
"0.0.7"

Recur Quickstart

You are helping a developer integrate Recur, Taiwan's subscription payment platform (similar to Stripe Billing).

Step 1: Install SDK

pnpm add recur-tw
# or
npm install recur-tw

Step 2: Get API Keys

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 keys

Environment variables to set:

RECUR_PUBLISHABLE_KEY=pk_test_xxx
RECUR_SECRET_KEY=sk_test_xxx

Step 3: Add Provider (React)

Wrap your app with RecurProvider:

import { RecurProvider } from 'recur-tw'

export default function App({ children }) {
  return (
    <RecurProvider
      config={{
        publishableKey: process.env.NEXT_PUBLIC_RECUR_PUBLISHABLE_KEY,
      }}
    >
      {children}
    </RecurProvider>
  )
}

Step 4: Create Your First Checkout

import { useRecur } from 'recur-tw'

function PricingButton({ productId }: { productId: string }) {
  const { checkout } = useRecur()

  const handleCheckout = async () => {
    await checkout({
      productId,
      onPaymentComplete: (subscription) => {
        console.log('Payment successful!', subscription)
      },
      onPaymentFailed: (error) => {
        console.error('Payment failed:', error)
      },
    })
  }

  return <button onClick={handleCheckout}>Subscribe</button>
}

Step 5: Set Up Webhooks

Create a webhook endpoint to receive payment notifications. See the recur-webhooks skill for detailed instructions.

Quick Verification Checklist

  • [ ] SDK installed (pnpm list recur-tw)
  • [ ] Environment variables set
  • [ ] RecurProvider wrapping app
  • [ ] Test checkout works in sandbox
  • [ ] Webhook endpoint configured

Common Issues

"Invalid API key"

  • Check key format: must start with pk_test_, sk_test_, pk_live_, or sk_live_
  • Ensure using publishable key for frontend, secret key for backend

"Product not found"

  • Verify product exists in Recur dashboard
  • Check you're using correct environment (sandbox vs production)

Checkout not appearing

  • Ensure RecurProvider wraps your app
  • Check browser console for errors
  • Verify publishable key is correct

Next Steps

  • /recur-checkout - Learn checkout flow options
  • /recur-webhooks - Set up payment notifications
  • /recur-entitlements - Implement access control

Resources

You Might Also Like

Related Skills

gog

gog

169Kdev-api

Google Workspace CLI for Gmail, Calendar, Drive, Contacts, Sheets, and Docs.

openclaw avataropenclaw
獲取
weather

weather

169Kdev-api

Get current weather and forecasts (no API key required).

openclaw avataropenclaw
獲取

Guide for implementing oRPC contract-first API patterns in Dify frontend. Triggers when creating new API contracts, adding service endpoints, integrating TanStack Query with typed contracts, or migrating legacy service calls to oRPC. Use for all API layer work in web/contract and web/service directories.

langgenius avatarlanggenius
獲取
blucli

blucli

92Kdev-api

BluOS CLI (blu) for discovery, playback, grouping, and volume.

moltbot avatarmoltbot
獲取
ordercli

ordercli

92Kdev-api

Foodora-only CLI for checking past orders and active order status (Deliveroo WIP).

moltbot avatarmoltbot
獲取
gifgrep

gifgrep

92Kdev-api

Search GIF providers with CLI/TUI, download results, and extract stills/sheets.

moltbot avatarmoltbot
獲取