2.0 KiB
2.0 KiB
Quick Strapi Webhook Setup
TL;DR - Quick Configuration
- Access Strapi Admin:
http://localhost:1337/admin - Go to Settings → Webhooks
- Add New Webhook:
- Name:
Backend Sync - URL:
http://localhost:3000/api/v1/webhooks/strapi - Events: Select all for "Article" and "Live Blog" content types
- Name:
- Save and Test
Already Configured (What We Fixed)
✅ Backend webhook endpoints are now public (no auth required)
✅ Tested webhooks manually - they work
✅ Articles sync from Strapi to backend
✅ Frontend TypeScript errors fixed
✅ Authentication system working
Manual Test Commands
# Test webhook manually
curl -X POST http://localhost:3000/api/v1/webhooks/strapi \
-H "Content-Type: application/json" \
-d '{
"event": "entry.publish",
"model": "article",
"entry": {"documentId": "r07qatlpgvx82d7337n3nz1l"}
}'
# Check synced articles
curl http://localhost:3000/api/v1/articles?status=published
# Run comprehensive test
./scripts/test-webhooks.sh
Current Status
- Strapi Articles: 2
- Backend Articles: 2 (synced)
- Webhook Status: Ready for configuration
- Frontend: Access at
http://localhost:5173/articles
Immediate Action Required
- Configure webhooks in Strapi admin (see detailed guide in
STRAPI_WEBHOOKS_SETUP.md) - Test by publishing an article in Strapi
- Verify automatic sync works
If Webhooks Don't Work
Use manual sync as fallback:
# Get auth token first
TOKEN=$(curl -s -X POST http://localhost:3000/api/v1/auth/login \
-H "Content-Type: application/json" \
-d '{"username":"testuser","password":"Test123!"}' | jq -r '.access_token')
# Sync all articles
curl -X POST http://localhost:3000/api/v1/webhooks/strapi/sync/all \
-H "Authorization: Bearer $TOKEN"
Verification
- Visit
http://localhost:5173/articlesto see synced articles - Check backend logs:
docker logs placebo-backend-dev --tail 20 - Monitor sync status with test script:
./scripts/test-webhooks.sh