Integrate PostHog into any python application.
89
Build an event tracking system for a serverless AWS Lambda function that processes user actions. The system must reliably track events even when the Lambda execution environment terminates immediately after processing.
Your implementation should include:
The handler receives a dictionary with:
user_id (string) - Unique identifier for the useraction (string) - The action performed (e.g., "button_click", "page_view")metadata (dict, optional) - Additional properties about the action@generates
def handle_user_action(event: dict) -> dict:
"""
Handle a user action event in a serverless environment.
Args:
event: Dictionary containing user_id, action, and optional metadata
Returns:
Dictionary with 'success' boolean and optional 'message'
"""
passProvides analytics and event tracking capabilities.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/pypi-posthogdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10