mirror of
https://github.com/hanzoai/insights-python.git
synced 2026-10-30 18:33:17 +00:00
- Remove Posthog = Insights alias from __init__.py - Remove PosthogContextMiddleware alias from django.py - Remove PostHogTracingProcessor alias from processor.py - Change $lib from "posthog-python" to "insights-python" - Change ingestion URLs from posthog.com to insights.hanzo.ai - Rename all posthog_* kwargs to insights_* across AI wrappers - Rename __posthog_exception_captured to __insights_exception_captured - Rename posthog_context_stack contextvar to insights_context_stack - Rename posthog🎏 Redis prefix to insights🎏 - Rename $$_posthog_redacted_* sentinels to $$_insights_redacted_* - Remove POSTHOG_MW_* Django settings fallback, X-POSTHOG-* headers - Rename Prompts(posthog=) param to Prompts(client=) - Update APP_ENDPOINT to us.insights.hanzo.ai - Update all tests, examples, docs, mypy config
33 lines
934 B
Python
33 lines
934 B
Python
#!/usr/bin/env python3
|
|
"""
|
|
Simple test script for Insights remote config endpoint.
|
|
"""
|
|
|
|
import hanzo_insights
|
|
|
|
# Initialize Insights client
|
|
hanzo_insights.api_key = "phc_..."
|
|
hanzo_insights.personal_api_key = "phs_..." # or "phx_..."
|
|
hanzo_insights.host = "http://localhost:8000" # or "https://us.insights.hanzo.ai"
|
|
hanzo_insights.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 = hanzo_insights.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()
|