Bitwarden.Server.Sdk.Environment
0.1.0
Prefix Reserved
dotnet add package Bitwarden.Server.Sdk.Environment --version 0.1.0
NuGet\Install-Package Bitwarden.Server.Sdk.Environment -Version 0.1.0
<PackageReference Include="Bitwarden.Server.Sdk.Environment" Version="0.1.0" />
<PackageVersion Include="Bitwarden.Server.Sdk.Environment" Version="0.1.0" />
<PackageReference Include="Bitwarden.Server.Sdk.Environment" />
paket add Bitwarden.Server.Sdk.Environment --version 0.1.0
#r "nuget: Bitwarden.Server.Sdk.Environment, 0.1.0"
#:package Bitwarden.Server.Sdk.Environment@0.1.0
#addin nuget:?package=Bitwarden.Server.Sdk.Environment&version=0.1.0
#tool nuget:?package=Bitwarden.Server.Sdk.Environment&version=0.1.0
Bitwarden.Server.Sdk.Environment
Provides runtime environment information for Bitwarden server services, including version, Git hash, and self-host details.
Getting Started
Register the environment services in your DI container:
services.AddBitwardenEnvironment();
If your service can run in a self-hosted configuration, configure SelfHostDetails accordingly:
using Bitwarden.Server.Sdk.Environment.Setup;
// For a self-hosted instance:
services.Configure<SelfHostDetails>(details => details.MakeSelfHost("lite"));
// For a cloud instance (this is the default):
services.Configure<SelfHostDetails>(details => details.MakeCloud());
Usage
Inject IBitwardenEnvironment wherever you need environment information:
public class MyService(IBitwardenEnvironment environment)
{
public void LogInfo()
{
Console.WriteLine($"Version: {environment.Version}");
Console.WriteLine($"Git hash: {environment.GitHash}");
Console.WriteLine($"Self-hosted: {environment.SelfHosted}");
Console.WriteLine($"Flavor: {environment.SelfHostFlavor}");
}
}
Version Resolution
The version and Git hash are read from the AssemblyInformationalVersionAttribute of the
application's entry assembly. The attribute value is expected to follow the format
{version}+{gitHash} (e.g., 1.2.3+af18b2952b), which is produced automatically by the .NET SDK
when source control metadata is embedded in the build.
If the attribute is missing or cannot be parsed, Version returns an empty string and GitHash
returns null, and a warning is logged.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.9)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.9)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.9)
- Microsoft.Extensions.Options (>= 10.0.9)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Bitwarden.Server.Sdk.Environment:
| Package | Downloads |
|---|---|
|
Bitwarden.Server.Sdk.Features
Feature flag support for Bitwarden server services, backed by LaunchDarkly. Includes middleware, endpoint conventions, and controller attributes for remotely toggling features. |
|
|
Bitwarden.Server.Sdk.WebEssentials
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0 | 95 | 7/28/2026 |