Skip to content
This repository was archived by the owner on Jan 27, 2026. It is now read-only.

Commit d34e9af

Browse files
committed
commandments
1 parent c7fa4bd commit d34e9af

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

transformation-config/commandments.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,8 @@ commandments:
2323
- Use the context API pattern with new_context(), identify_context(user_id), then capture()
2424
- For login/logout views, create a new context since user state changes during the request
2525
- Do NOT create custom middleware, distinct_id helpers, or conditional checks - the SDK handles these
26-
26+
27+
flask:
28+
- Initialize PostHog globally in create_app() using posthog.api_key and posthog.host (NOT per-request)
29+
- Manually capture exceptions with `posthog.capture_exception(e)` for error tracking since Flask has built-in error handlers
30+
- Blueprint registration happens AFTER PostHog initialization in create_app()

0 commit comments

Comments
 (0)