MCPcopy
hub / github.com/PostHog/posthog / get_instance_setting

Function get_instance_setting

posthog/api/instance_settings.py:42–54  ·  view source on GitHub ↗
(key: str, setting_config: Optional[Tuple] = None)

Source from the content-addressed store, hash-verified

40
41
42def get_instance_setting(key: str, setting_config: Optional[Tuple] = None) -> InstanceSettingHelper:
43 setting_config = setting_config or CONSTANCE_CONFIG[key]
44 is_secret = key in SECRET_SETTINGS
45 value = get_instance_setting_raw(key)
46
47 return InstanceSettingHelper(
48 key=key,
49 value=value if not is_secret or not value else "*****",
50 value_type=re.sub(r"<class '(\w+)'>", r"\1", str(setting_config[2])),
51 description=setting_config[1],
52 editable=key in SETTINGS_ALLOWING_API_OVERRIDE,
53 is_secret=is_secret,
54 )
55
56
57class InstanceSettingsSerializer(serializers.Serializer):

Calls 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…