- Add CONTEXT.md with ADHD-optimized task management patterns - Add troubleshooting guide for productivity tools - Add n8n workflow documentation including Ko-fi integration - Document n8n at LXC 210 (10.10.0.210) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
8.7 KiB
Ko-fi → Paper Dynasty Quick Start Guide
Get the Ko-fi integration running in 30 minutes.
Prerequisites Checklist
Before you start, gather these items:
- Ko-fi verification token (from Ko-fi dashboard)
- Paper Dynasty API key (production)
- Discord webhook URL for notifications
- List of Ko-fi product codes you'll sell
- Access to n8n at https://n8n.manticorum.com
Setup Steps
Step 1: Get Ko-fi Verification Token (2 minutes)
- Login to Ko-fi: https://ko-fi.com/
- Navigate to: Settings → API → Webhooks → Advanced (dropdown)
- Copy the Verification Token (looks like:
8c2a3835-4544-4f27-a53a-adfd1fcc5664) - Save it securely - you'll add it to n8n next
Step 2: Create Discord Webhook (2 minutes)
- Open Discord channel where you want notifications
- Channel Settings → Integrations → Webhooks → New Webhook
- Name it: "Ko-fi Paper Dynasty"
- Copy webhook URL (looks like:
https://discord.com/api/webhooks/...) - Save URL - you'll add it to n8n next
Step 3: Configure n8n Credentials (5 minutes)
Login to n8n and create three credentials:
Credential 1: Ko-fi Verification Token
- n8n → Settings → Credentials → Add Credential
- Search for "Generic Credential"
- Name:
Ko-fi Verification Token - Add field:
verification_token - Value:
[paste your Ko-fi token here] - Save
Credential 2: Paper Dynasty API
- Add Credential → Search for "Header Auth"
- Name:
Paper Dynasty API - Header Name:
Authorization - Value:
Bearer [your-pd-api-key] - Save
Credential 3: Discord Webhook
- Add Credential → Search for "Discord Webhook"
- Name:
Discord Ko-fi Notifications - Webhook URL:
[paste Discord webhook URL] - Save
Step 4: Create Product Mapping (5 minutes)
- n8n → Settings → Variables → Add Variable
- Variable Name:
KOFI_PRODUCT_MAP - Value: Copy and customize this JSON:
{
"pack-standard-5": {
"name": "5-Pack Standard",
"pack_type_id": 1,
"quantity": 5,
"pack_cardset_id": null
},
"pack-premium-10": {
"name": "10-Pack Premium",
"pack_type_id": 3,
"quantity": 10,
"pack_cardset_id": null
}
}
Important: Replace pack-standard-5 and pack-premium-10 with your actual Ko-fi product codes.
- Save variable
Step 5: Import Workflow (10 minutes)
Option A: Manual Creation
Follow the detailed node-by-node instructions in kofi-paper-dynasty.md
Option B: JSON Import (if workflow JSON provided)
- n8n → Workflows → Add Workflow → Import from File
- Select workflow JSON file
- Review imported nodes
- Update credential references if needed
- Activate workflow
Key Nodes to Verify:
- Webhook path:
/kofi-paperdy(use/webhook-test/kofi-paperdyinitially) - Token validation references correct credential
- Product mapping loads from variable
- API endpoints correct (
https://pd.manticorum.com/api/v2/) - Discord notifications reference correct credential
Step 6: Test the Workflow (5 minutes)
Quick Test with cURL:
# Replace YOUR_KOFI_TOKEN_HERE with your actual token
curl -X POST 'https://n8n.manticorum.com/webhook-test/kofi-paperdy' \
-H 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'data={
"verification_token": "YOUR_KOFI_TOKEN_HERE",
"message_id": "quick-test-001",
"timestamp": "2025-11-13T12:00:00Z",
"type": "Shop Order",
"from_name": "Test User",
"message": "Team: SKB",
"amount": "5.00",
"email": "[email protected]",
"currency": "USD",
"kofi_transaction_id": "quick-test-001",
"shop_items": [
{
"direct_link_code": "pack-standard-5",
"variation_name": "5-Pack Standard",
"quantity": 1
}
],
"discord_userid": null
}'
Expected Results:
- ✅ n8n shows successful execution
- ✅ Discord notification received
- ✅ If using real API, 5 packs granted to team SKB
Step 7: Configure Ko-fi Webhook (3 minutes)
- Ko-fi → Settings → API → Webhooks
- Webhook URL:
https://n8n.manticorum.com/webhook-test/kofi-paperdy(test first!) - Save
- Click "Test Webhook" button
- Verify n8n receives webhook and processes successfully
- Check Discord for test notification
Step 8: Go Live (2 minutes)
Once testing is successful:
-
Update workflow webhook path:
- n8n → Edit Workflow → Webhook node
- Change path from
webhook-test/kofi-paperdytowebhook/kofi-paperdy - Save and activate workflow
-
Update Ko-fi webhook URL:
- Ko-fi → Settings → API → Webhooks
- Change URL to:
https://n8n.manticorum.com/webhook/kofi-paperdy - Save
-
Monitor first transactions:
- Watch Discord channel closely
- Review n8n execution logs
- Verify packs granted correctly in Paper Dynasty
Done! Your Ko-fi integration is now live.
Post-Setup Tasks
Create Ko-fi Products
For each pack type you want to sell:
- Ko-fi → Shop → Add Product
- Product Name: "5-Pack Standard Bundle"
- Price: $5.00
- Description: "Five standard Paper Dynasty packs"
- Advanced Settings → Product Code:
pack-standard-5- ⚠️ This MUST match your product mapping!
- Add product image
- Publish product
Repeat for each pack type (premium, team choice, etc.)
Document Your Product Codes
Keep a master list of all Ko-fi product codes and their mappings:
| Ko-fi Code | Pack Type | Quantity | Price | PD pack_type_id |
|---|---|---|---|---|
| pack-standard-5 | Standard | 5 | $5.00 | 1 |
| pack-standard-10 | Standard | 10 | $9.00 | 1 |
| pack-premium-5 | Premium | 5 | $10.00 | 3 |
| pack-premium-10 | Premium | 10 | $18.00 | 3 |
| pack-team-choice | Team Choice | 1 | $3.00 | 8 |
Update this when adding new products!
Set Up Monitoring
Create a monitoring checklist:
- Check Discord notifications daily
- Review n8n execution logs weekly
- Verify pack distribution accuracy weekly
- Update product mapping when adding Ko-fi products
- Test disaster recovery monthly
Backup n8n
Create weekly backup:
ssh root@10.10.0.210 "
cd /opt/n8n && \
docker compose exec -T postgres pg_dump -U n8n n8n > \
/root/n8n-backup-\$(date +%Y%m%d-%H%M%S).sql
"
# Download backup
scp root@10.10.0.210:/root/n8n-backup-*.sql ~/backups/n8n/
Troubleshooting
Webhook Not Receiving Data
Check:
# Test webhook endpoint
curl -I https://n8n.manticorum.com/webhook-test/kofi-paperdy
# Should return: 200 OK or 400 Bad Request (not 404)
Fix:
- Ensure workflow is Active (toggle in n8n UI)
- Verify webhook path matches Ko-fi configuration
- Check n8n logs:
ssh root@10.10.0.210 "cd /opt/n8n && docker compose logs -f n8n"
Token Validation Failing
Check:
- Token in n8n credential matches Ko-fi exactly (no spaces!)
- Credential name in IF node:
{{ $credentials.kofiVerificationToken.verification_token }}
Fix:
- Re-copy token from Ko-fi
- Update n8n credential
- Test again
Team Not Found
Check:
- User has discord_userid linked in Paper Dynasty
- OR user included team abbrev in message (e.g., "Team: SKB")
- Team abbreviation exists in PD database
Fix:
- Manual review Discord notification will be sent
- Admin grants packs manually using transaction ID
Packs Not Granted
Check:
- n8n execution log shows 200 OK from PD API
- Product code exists in
KOFI_PRODUCT_MAPvariable - pack_type_id is valid
Verify in Paper Dynasty:
from api_client import PaperDynastyAPI
api = PaperDynastyAPI(environment='prod')
api.list_packs(team_id=69, opened=False, limit=20)
Next Steps
Now that your integration is running:
- Read full documentation:
kofi-paper-dynasty.md - Review test scenarios:
kofi-testing-guide.md - Customize product mapping: Add more pack types
- Set up monitoring alerts: Create health check workflow
- Document your process: Add notes for future reference
Support Resources
Documentation:
- Full Setup:
kofi-paper-dynasty.md - Testing Guide:
kofi-testing-guide.md - Product Mapping:
kofi-product-mapping-template.json - n8n Context:
/productivity/n8n/CONTEXT.md
External Resources:
- Ko-fi Webhook Docs: https://help.ko-fi.com/hc/en-us/articles/360004162298
- n8n Documentation: https://docs.n8n.io/
- Paper Dynasty API: See
/home/cal/.claude/skills/paper-dynasty/SKILL.md
Need Help?
- Review n8n execution logs for detailed error messages
- Check Discord notifications for manual review requests
- Test with cURL to isolate issues
- Consult troubleshooting guide in main documentation
Change Log
2025-11-13 - Initial Version
- Created quick start guide
- Defined 30-minute setup process
- Added troubleshooting quick reference
- Included post-setup tasks and monitoring