Skip to content

Commit

Permalink
fix: Add env var for session replay
Browse files Browse the repository at this point in the history
  • Loading branch information
timgl committed Sep 20, 2023
1 parent 3004b88 commit 7c96a57
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 4 additions & 2 deletions posthog/api/decide.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,10 @@ def get_decide(request: HttpRequest):
else False
)

if team.session_recording_opt_in and (
on_permitted_recording_domain(team, request) or not team.recording_domains
if (
settings.DECIDE_ALLOW_SESSION_REPLAY
and team.session_recording_opt_in
and (on_permitted_recording_domain(team, request) or not team.recording_domains)
):
capture_console_logs = True if team.capture_console_log_opt_in else False
response["sessionRecording"] = {
Expand Down
3 changes: 3 additions & 0 deletions posthog/settings/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@
"DECIDE_SKIP_HASH_KEY_OVERRIDE_WRITES", False, type_cast=str_to_bool
)


DECIDE_ALLOW_SESSION_REPLAY = get_from_env("DECIDE_ALLOW_SESSION_REPLAY", True, type_cast=str_to_bool)

# Application definition

INSTALLED_APPS = [
Expand Down

0 comments on commit 7c96a57

Please sign in to comment.