File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python3
2+ """
3+ Simple test script for PostHog remote config endpoint.
4+ """
5+
6+ import posthog
7+
8+ # Initialize PostHog client
9+ posthog .api_key = "phc_..."
10+ posthog .personal_api_key = "phs_..." # or "phx_..."
11+ posthog .host = "http://localhost:8000" # or "https://us.posthog.com"
12+ posthog .debug = True
13+
14+
15+ def test_remote_config ():
16+ """Test remote config payload retrieval."""
17+ print ("Testing remote config endpoint..." )
18+
19+ # Test feature flag key - replace with an actual flag key from your project
20+ flag_key = "unencrypted-remote-config-setting"
21+
22+ try :
23+ # Get remote config payload
24+ payload = posthog .get_remote_config_payload (flag_key )
25+ print (f"✅ Success! Remote config payload for '{ flag_key } ': { payload } " )
26+
27+ except Exception as e :
28+ print (f"❌ Error getting remote config: { e } " )
29+
30+
31+ if __name__ == "__main__" :
32+ test_remote_config ()
You can’t perform that action at this time.
0 commit comments