A REST API endpoint that receives Typeform webhook submissions and forwards them as events to PostHog.
POSTHOG_API_KEY environment variable in your Val Town settings with your PostHog API key.Accepts Typeform webhook payloads and sends a typeform_completed event to PostHog.
Request Body:
{ "form_response": { "form_id": "form_123", "token": "response_456", "submitted_at": "2024-01-01T12:00:00Z", "landed_at": "2024-01-01T11:55:00Z", "hidden": { "user_id": "user_789", "source": "email_campaign" } } }
Response:
200 OK: Event successfully sent to PostHog500 Internal Server Error: Missing API key or PostHog API errorHealth check endpoint that returns API information.
The endpoint sends events to PostHog with the following structure:
typeform_completedhidden.user_id, falls back to landed_at, then 'anonymous'form_id: Typeform form identifierresponse_id: Typeform response tokensubmitted_at: Submission timestampIn your Typeform settings:
https://your-val-url.web.val.run/typeform-submitPOSTHOG_API_KEY: Your PostHog project API key (required)