{"id":27260901,"url":"https://github.com/ppech/env-info","last_synced_at":"2026-02-13T13:08:05.102Z","repository":{"id":64967842,"uuid":"576360959","full_name":"ppech/env-info","owner":"ppech","description":"Enviroment info controls for Mvc/RazorPages and DotVVM","archived":false,"fork":false,"pushed_at":"2025-02-17T07:39:41.000Z","size":190,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-12T05:05:32.217Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ppech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-12-09T16:48:00.000Z","updated_at":"2025-02-17T07:39:44.000Z","dependencies_parsed_at":"2025-02-12T14:42:27.039Z","dependency_job_id":"d79d429e-32b5-4b1e-9558-a5648d44c9dc","html_url":"https://github.com/ppech/env-info","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ppech/env-info","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppech%2Fenv-info","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppech%2Fenv-info/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppech%2Fenv-info/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppech%2Fenv-info/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ppech","download_url":"https://codeload.github.com/ppech/env-info/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppech%2Fenv-info/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263061405,"owners_count":23407606,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-04-11T04:54:35.139Z","updated_at":"2026-02-13T13:08:00.072Z","avatar_url":"https://github.com/ppech.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EnvInfo\n\n[![License](https://img.shields.io/github/license/ppech/dotnet-hostsctl)](LICENSE)\n\nEnvInfo is a collection of Mvc/RazorPages tag helpers and DotVVM controls that provides environment information \nfor your application. It is useful for identifing between different environments like Development, Staging, and Production.\n\n## Features\n* display environment name (e.g., DEV, STAG, PROD) based on the current environment\n* ability to change environment name or visility using configuration\n* display Bootstrap breakpoint name (e.g., xs, sm, md, lg, xl) based on the current screen width\n* ability to change predefined styles using custom css\n\n## Usage\n\nInstall nuget package for each UI framework you use in your project. Then register required service in `Program.cs` or `Startup.cs` file\n\n```csharp\nbuilder.Services.AddEnvInfo();\n```\n\nBy default, the Name is derived from the environment name and Visible is set to true \nfor the development environment. Then tries to load the configuration section `EnvInfo`\nand set the values.\n\n```json\n\"EnvInfo\": {\n    \"Name\": \"ALPHA\",\n    \"Visible\": true\n}\n```\n\nYou can provide custom configuration section.\n\n```csharp\nservices.AddEnvInfo(Configuration.GetSection(\"App.EnvInfo\"));\n```\n\nOr you can override Name directly in code\n```csharp\nbuilder.Services.AddEnvInfo(\"APLHA\");\n```\n\nOr simply provide custom configuration object\n\n```csharp\nservices.AddEnvInfo(new EnvInfoOptions\n{\n    Name = \"CUSTOM\",\n    Visible = true\n});\n```\n\n### MVC / Razor Pages\n[![Latest version](https://img.shields.io/nuget/v/EnvInfo.MVC.svg)](https://www.nuget.org/packages/EnvInfo.MVC)\n\nAdd tag helpers import to `_ViewImports.cshtml` file\n```razor\n@addTagHelper *, EnvInfo.Mvc\n```\n\nBelow is basic usage snippet that displays environment name. Place it before `\u003c/body\u003e` element in your `.cshtml` file\n```html\n\u003cenv-info\u003e\n    \u003cenv-name /\u003e\n\u003c/env-info\u003e\n```\n\nInside `env-info` tag you can use any html element or any of predefined tag helpers:\n* `\u003cenv-name /\u003e` - displays environment name\n* `\u003cbs4-breakpoints /\u003e` - displays Bootstrap 4 breakpoint name\n* `\u003cbs5-breakpoints /\u003e` - displays Bootstrap 5 breakpoint name\n* `\u003cbs-breakpoints breakpoints=\"xxs xs sm md lg xl xxl 3xl\" /\u003e` - displays custom Bootstrap breakpoint name\n\nBelow is an example of usage with custom html and predefined tag helper\n```html\n\u003cenv-info\u003e\n    \u003cenv-name /\u003e\n    \u003cspan\u003e|\u003c/span\u003e\n    \u003cbs4-breakpoints /\u003e\n\u003c/env-info\u003e\n```\n\n### Blazor WASM / Razor Components\n[![Latest version](https://img.shields.io/nuget/v/EnvInfo.Razor.svg)](https://www.nuget.org/packages/EnvInfo.Razor)\n\nIn `Program.cs` of Server app add this line of code below `app.UseBlazorFrameworkFiles()`, which registers endpoint for fetching environment information.\n```csharp\napp.UseBlazorEnvInfo();\n```\n\nThen in `Program.cs` of Blazor WASM app add this line of code to builder\n```csharp\nawait builder.AddEnvInfo();\n```\n\nAnd finally add this lines of code before `\u003c/body\u003e` element\n```html\n\u003cEnvInfo.Razor.EnvInfo\u003e\n    \u003cEnvInfo.Razor.EnvName /\u003e\n    \u003cspan\u003e|\u003c/span\u003e\n    \u003cEnvInfo.Razor.Bs4Breakpoints /\u003e\n\u003c/EnvInfo.Razor.EnvInfo\u003e\n```\n\n### DotVVM\n[![Latest version](https://img.shields.io/nuget/v/EnvInfo.DotVVM.svg)](https://www.nuget.org/packages/EnvInfo.DotVVM)\n\nAdd control registration to Configure method in DotvvmStartup file.\n```csharp\nconfig.AddEnvInfoConfiguration();\n```\n\nBelow is basic usage snippet that displays environment name. Place it  before `\u003c/body\u003e` element in your `.dotmaster` or `.dothtml` file\n```html\n\u003cdot:EnvInfo\u003e\n    \u003cdot:EnvName /\u003e\n\u003c/dot:EnvInfo\u003e\n```\n\nInside `env-info` tag you can use any html element or any of predefined controls:\n* `\u003cdot:EnvName /\u003e` - displays environment name\n* `\u003cdot:Bootstrap4Breakpoints /\u003e` - displays Bootstrap 4 breakpoint name\n* `\u003cdot:Bootstrap5Breakpoints /\u003e` - displays Bootstrap 5 breakpoint name\n* `\u003cdot:BootstrapBreakpoints Breakpoints=\"xxs xs sm md lg xl xxl 3xl\" /\u003e` - displays custom Bootstrap breakpoint name\n\nBelow is an example of usage with custom html and predefined control\n```html\n\u003cdot:EnvInfo\u003e\n    \u003cdot:EnvName /\u003e\n    \u003cspan\u003e|\u003c/span\u003e\n    \u003cdot:Bootstrap4Breakpoints /\u003e\n\u003c/dot:EnvInfo\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fppech%2Fenv-info","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fppech%2Fenv-info","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fppech%2Fenv-info/lists"}