A community-driven open-source package that brings sustainability insights and audits to Xperience by Kentico, inspired by the brilliant work of the Umbraco Community Sustainability Team, and the Umbraco.Community.Sustainability package. 🌿
For more details about this package, check out Bringing Sustainability Insights to Xperience by Kentico which provides more background information around the package and its origin.
| Xperience Version | Library Version |
|---|---|
| >= 30.12.0 | 3.x |
| >= 30.4.2 | 1.x - 2.x |
Add the package to your application using the .NET CLI
dotnet add package XperienceCommunity.Sustainability-
Install NuGet package above.
-
Register the Sustainability services using
builder.Services.AddXperienceCommunitySustainability():// Program.cs var builder = WebApplication.CreateBuilder(args); builder.Services.AddKentico(); // ... builder.Services.AddXperienceCommunitySustainability(builder.Configuration);
-
The Sustainability tab will automatically appear on content pages in the Xperience admin interface.
Note: Playwright browsers (Chromium) are automatically installed on first application startup. The installation path defaults to
App_Data/playwrightunless you're hosting on a UNC path.
The package uses the Sustainable Web Design Model v4 (SWDM v4) from The Green Web Foundation to calculate carbon emissions. Carbon ratings (A+ through F) follow the official Digital Carbon Ratings methodology.
The package automatically checks if your website is hosted on a green energy provider using The Green Web Foundation's database. This affects the carbon calculation:
- Green hosting: Uses renewable energy intensity values (lower emissions)
- Standard hosting: Uses global grid intensity values
- Unknown: When verification fails, conservative estimates are used
The hosting status is displayed in the Sustainability report with three possible states:
- ● Green hosting - Site uses renewable/green energy
- ● Standard hosting - Site uses standard grid energy
- ● Unknown hosting - Unable to verify hosting provider
Once installed, a new tab appears for each page in your web channels. The Sustainability tab allows content editors and marketers to see and benchmark page weight and carbon emissions, which is then converted to a carbon rating for individual pages.
Each report includes:
- Carbon Rating: Letter grade (A+ through F) based on grams CO₂ per page view
- CO₂ Emissions: Total carbon emissions with hosting status indicator
- Page Weight: Total size of all resources loaded
- Resource Breakdown: Categorized by type (Images, Scripts, CSS, etc.) with individual file sizes
- Optimization Tips: Xperience-specific recommendations for reducing page weight
- PDF Export: Download complete sustainability reports as PDF for sharing and documentation
Track sustainability improvements over time with comprehensive historical reporting:
- Trend Analysis: Two side-by-side charts showing CO₂ emissions and page weight trends over time
- Report History: View all previous sustainability reports for a page with collapsible cards showing key metrics
- Pagination: Load historical reports in batches to efficiently browse through your sustainability history
- Before/After Comparison: Compare current and historical reports to measure the impact of optimizations
The package can be configured using the Sustainability section in your appsettings.json file.
{
"Sustainability": {
"TimeoutMilliseconds": 60000,
"PlaywrightBrowserPath": "/custom/path/to/playwright/browsers",
"EnableBrowserConsoleLogging": false
}
}| Option | Description | Default |
|---|---|---|
TimeoutMilliseconds |
Timeout in milliseconds for waiting for sustainability data to be collected from the page. | 60000 (60 seconds) |
PlaywrightBrowserPath |
Custom path where Playwright browsers should be installed. Only required when hosting on UNC paths (network shares starting with \\). For standard hosting, browsers are automatically installed in App_Data/playwright. |
null |
EnableBrowserConsoleLogging |
Enable browser console logging to Kentico Event Log for debugging purposes. When enabled, all console messages from the headless browser are logged to help troubleshoot issues. | false |
Note on UNC Hosting: When hosting on UNC paths (network shares), you must configure
PlaywrightBrowserPathor the application will throw an error during startup. This setting is ignored for standard hosting scenarios.
Feel free to submit issues or pull requests to the repository, this is a community package and everyone is welcome to support.
Distributed under the MIT License. See LICENSE.md for more information.
If you find this package helpful, please consider giving it a star!