Skip to content

Add default PostHog SDK client facade#190

Draft
marandaneto wants to merge 1 commit intomainfrom
feat/add-default-posthog-sdk-client
Draft

Add default PostHog SDK client facade#190
marandaneto wants to merge 1 commit intomainfrom
feat/add-default-posthog-sdk-client

Conversation

@marandaneto
Copy link
Copy Markdown
Member

💡 Motivation and Context

Adds an optional process-wide default PostHog client facade for console apps, scripts, and other places where passing an IPostHogClient instance around is inconvenient.

💚 How did you test it?

  • dotnet build src/PostHog/PostHog.csproj --no-restore -v:minimal
  • dotnet test tests/UnitTests/UnitTests.csproj --framework net8.0 --no-restore --filter PostHogSdkTests -v:minimal

📝 Checklist

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • I updated the docs if needed.
  • No breaking change or entry added to the changelog.

If releasing new changes

  • Added the release label to the PR
  • Added exactly one version bump label: bump-patch, bump-minor, or bump-major

@github-actions
Copy link
Copy Markdown
Contributor

posthog-dotnet Compliance Report

Date: 2026-04-30 12:44:29 UTC
Duration: 221ms

⚠️ Some Tests Failed

0/1 tests passed, 1 failed


Feature_Flags Tests

⚠️ 0/1 tests passed, 1 failed

View Details
Test Status Duration
Request Payload.Request With Person Properties Device Id 42ms

Failures

request_payload.request_with_person_properties_device_id

404, message='Not Found', url='http://sdk-adapter:8080/get_feature_flag'

@marandaneto
Copy link
Copy Markdown
Member Author

@haacked wdyt? i noticed some SDKs don't have a global facade, and you have to pass it around, and sometimes passing it around is tricky, you have to change a lot of method and ctor signatures, and make your code even more coupled to PostHog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant