forked from PostHog/posthog-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathremote_config.py
More file actions
32 lines (23 loc) · 884 Bytes
/
remote_config.py
File metadata and controls
32 lines (23 loc) · 884 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env python3
"""
Simple test script for PostHog remote config endpoint.
"""
import posthog
# Initialize PostHog client
posthog.api_key = "phc_..."
posthog.personal_api_key = "phs_..." # or "phx_..."
posthog.host = "http://localhost:8010" # or "https://us.posthog.com"
posthog.debug = True
def test_remote_config():
"""Test remote config payload retrieval."""
print("Testing remote config endpoint...")
# Test feature flag key - replace with an actual flag key from your project
flag_key = "unencrypted-remote-config-setting"
try:
# Get remote config payload
payload = posthog.get_remote_config_payload(flag_key)
print(f"✅ Success! Remote config payload for '{flag_key}': {payload}")
except Exception as e:
print(f"❌ Error getting remote config: {e}")
if __name__ == "__main__":
test_remote_config()