![]() |
VOOZH | about |
dotnet add package PostHog --version 2.7.1
NuGet\Install-Package PostHog -Version 2.7.1
<PackageReference Include="PostHog" Version="2.7.1" />
<PackageVersion Include="PostHog" Version="2.7.1" />Directory.Packages.props
<PackageReference Include="PostHog" />Project file
paket add PostHog --version 2.7.1
#r "nuget: PostHog, 2.7.1"
#:package PostHog@2.7.1
#addin nuget:?package=PostHog&version=2.7.1Install as a Cake Addin
#tool nuget:?package=PostHog&version=2.7.1Install as a Cake Tool
This is a client SDK for the PostHog API written in C#. This is the core implementation of PostHog.
The goal of this package is to be usable in multiple .NET environments. At this moment, we are far short of that goal. We only support ASP.NET Core via .
More detailed docs for using this library can be found at PostHog Docs for the .NET Client SDK.
To use this package, create an instance of PostHogClient and call the appropriate methods. Here's an example:
using PostHog;
var client = new PostHogClient(new PostHogOptions { ProjectToken = "YOUR_PROJECT_TOKEN" });
client.Capture("user-123", "Test Event");
For console apps, scripts, or other places where passing a client instance around is inconvenient, you can configure a process-wide default client and use the PostHogSdk facade:
using PostHog;
using PostHog.Sdk;
PostHogSdk.Init(new PostHogOptions { ProjectToken = "YOUR_PROJECT_TOKEN" });
PostHogSdk.Capture("user-123", "Test Event");
await PostHogSdk.ShutdownAsync();
You can also assign an existing client:
using PostHog;
using PostHog.Sdk;
var client = new PostHogClient(new PostHogOptions { ProjectToken = "YOUR_PROJECT_TOKEN" });
PostHogSdk.DefaultClient = client;
PostHogSdk.Capture("user-123", "Test Event");
If no default client is configured, PostHogSdk methods are no-ops and log a warning once through Microsoft.Extensions.Logging. To enable SDK logs for the static facade and clients created by PostHogSdk.Init, set PostHogSdk.LoggerFactory before calling SDK methods:
using Microsoft.Extensions.Logging;
using PostHog.Sdk;
using var loggerFactory = LoggerFactory.Create(builder =>
{
builder.AddConsole();
builder.SetMinimumLevel(LogLevel.Information);
});
PostHogSdk.LoggerFactory = loggerFactory;
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 is compatible. |
| .NET Framework | net461 net461 was computed. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 2 NuGet packages that depend on PostHog:
| Package | Downloads |
|---|---|
|
PostHog.AspNetCore
Package Description |
|
|
PostHog.AI
AI Observability for .NET applications using PostHog. Intercepts and traces OpenAI and Azure OpenAI requests. |
Showing the top 1 popular GitHub repositories that depend on PostHog:
| Repository | Stars |
|---|---|
|
Ivy-Interactive/Ivy-Tendril
Agent agnostic coding orchestration
|
| Version | Downloads | Last Updated |
|---|---|---|
| 2.7.1 | 46,039 | 5/11/2026 |
| 2.7.0 | 2,177 | 5/7/2026 |
| 2.6.2 | 21,848 | 5/6/2026 |
| 2.6.1 | 2,298 | 5/5/2026 |
| 2.6.0 | 5,135 | 5/1/2026 |
| 2.5.0 | 38,624 | 4/23/2026 |
| 2.4.3 | 10,412 | 4/21/2026 |
| 2.4.2 | 224 | 4/21/2026 |
| 2.4.1 | 51,944 | 3/19/2026 |
| 2.4.0 | 39,135 | 3/5/2026 |
| 2.3.2 | 9,380 | 2/27/2026 |
| 2.3.1 | 233 | 2/27/2026 |
| 2.3.0 | 4,107 | 2/26/2026 |
| 2.2.2 | 218,242 | 11/21/2025 |
| 2.2.1 | 62,055 | 10/22/2025 |
| 2.2.0 | 3,763 | 10/17/2025 |
| 2.1.0 | 3,650 | 10/14/2025 |
| 2.0.1 | 26,145 | 9/28/2025 |
| 2.0.0 | 73,653 | 8/26/2025 |
| 1.0.8 | 43,760 | 8/7/2025 |