DJP
|
0621cf10ad
|
Add webhook logging for all user actions
Implemented complete webhook integration following the pattern
from AI-ASSISTANT app. All user actions now logged to Make.com.
NEW FILE:
- webhook_logger.php - Central webhook utility
WEBHOOK FUNCTIONS:
- sendToWebhook($data) - Core webhook sender
- logImageGeneration() - Log image creation/edits
- logPromptEnhancement() - Log prompt enhancements
- logUserAction() - Log general actions
WEBHOOK URL:
https://hook.us1.make.celonis.com/sbhcpk0athbdbxxmgijxc5sbwtjsg33h
DATA SENT:
Image Generation:
- client: 'Internal'
- deliverableNumber: 'NANO-{timestamp}'
- userEmail: from auth or anonymous
- generationType: 'Nano Banana Pro - Imagen 3'
- actionType: 'generate' or 'edit'
- prompt: user's prompt
- settings: {aspectRatio, imageSize, model}
- imageFile: 'data:image/png;base64,{image}'
Prompt Enhancement:
- generationType: 'Nano Banana Pro - Prompt Enhancement'
- actionType: 'prompt_enhancement'
- originalPrompt: scene description
- enhancedPrompt: AI-enhanced result
- settings: {camera, lens, application, creativeFreedom}
INTEGRATION POINTS:
- api.php - Logs every image generation/edit
- enhance_prompt.php - Logs every prompt enhancement
- Auth status included (user email)
ERROR HANDLING:
- Webhook failures don't break the app
- Errors logged to error_log
- 10 second timeout on webhook calls
- Graceful degradation
All user actions now tracked in Make.com! 📊
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
|
2025-12-16 11:55:23 -05:00 |
|