{"id":13314698,"url":"https://github.com/kontent-ai/aspnetcore-extensions","last_synced_at":"2025-06-18T15:41:22.380Z","repository":{"id":41813499,"uuid":"247054273","full_name":"kontent-ai/aspnetcore-extensions","owner":"kontent-ai","description":"ASP.NET Core extensions for Kontent.ai apps.","archived":false,"fork":false,"pushed_at":"2024-05-13T12:48:14.000Z","size":136,"stargazers_count":2,"open_issues_count":1,"forks_count":2,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-04-21T14:19:29.411Z","etag":null,"topics":["asp-net","kontent-ai","kontent-ai-tool","middleware","middlewares","tag-helper","tag-helpers"],"latest_commit_sha":null,"homepage":"https://www.nuget.org/packages/Kontent.Ai.AspNetCore","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/kontent-ai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null}},"created_at":"2020-03-13T11:18:17.000Z","updated_at":"2024-05-13T12:43:18.000Z","dependencies_parsed_at":"2022-09-11T12:41:45.951Z","dependency_job_id":null,"html_url":"https://github.com/kontent-ai/aspnetcore-extensions","commit_stats":null,"previous_names":["kentico/kontent-aspnetcore","kontent-ai/aspnetcore"],"tags_count":13,"template":false,"template_full_name":"Kentico/repo-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kontent-ai%2Faspnetcore-extensions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kontent-ai%2Faspnetcore-extensions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kontent-ai%2Faspnetcore-extensions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kontent-ai%2Faspnetcore-extensions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kontent-ai","download_url":"https://codeload.github.com/kontent-ai/aspnetcore-extensions/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252156905,"owners_count":21703371,"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":["asp-net","kontent-ai","kontent-ai-tool","middleware","middlewares","tag-helper","tag-helpers"],"created_at":"2024-07-29T18:11:53.545Z","updated_at":"2025-05-03T07:31:22.772Z","avatar_url":"https://github.com/kontent-ai.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ASP.NET Core extensions for Kontent.ai apps\n\n[![NuGet](https://img.shields.io/nuget/vpre/Kontent.Ai.AspNetCore.svg)](https://www.nuget.org/packages/Kontent.Ai.AspNetCore/)\n[![Downloads](https://img.shields.io/nuget/dt/Kontent.Ai.AspNetCore.svg)](https://www.nuget.org/packages/Kontent.Ai.AspNetCore/)\n[![Build \u0026 Test](https://github.com/kontent-ai/aspnetcore/actions/workflows/integrate.yml/badge.svg)](https://github.com/aspnetcore/actions/workflows/integrate.yml)\n[![codecov](https://codecov.io/gh/kontent-ai/aspnetcore/branch/master/graph/badge.svg?token=U4Y9PQDW6Q)](https://codecov.io/gh/kontent-ai/aspnetcore)\n[![Stack Overflow](https://img.shields.io/badge/Stack%20Overflow-ASK%20NOW-FE7A16.svg?logo=stackoverflow\u0026logoColor=white)](https://stackoverflow.com/tags/kontent-ai)\n[![Discord](https://img.shields.io/discord/821885171984891914?color=%237289DA\u0026label=Kontent.ai%20Discord\u0026logo=discord)](https://discord.gg/SKCxwPtevJ)\n\n## Tag Helpers\n\n### `img-asset` tag helper\n\nUseful for rendering responsive images. Supports Assets and Inline images in rich-text elements.\n\n`appsettings.json`:\n\n```json\n...\n\"ImageTransformationOptions\": {\n    \"ResponsiveWidths\": [ 200, 300, 400, 600, 800, 1000, 1200, 1400, 1600, 2000 ]\n  }\n...\n```\n\n`\\_ViewImports.cshtml`:\n\n```razor\n@addTagHelper *, Kontent.Ai.AspNetCore\n```\n\n`Startup.cs`:\n\n```csharp\npublic void ConfigureServices(IServiceCollection services)\n{\n    // Adds services required for using options.\n    services.AddOptions();\n\n    // Register the ImageTransformationOptions required by Kontent.ai tag helpers\n    services.Configure\u003cImageTransformationOptions\u003e(Configuration.GetSection(nameof(ImageTransformationOptions)));\n}\n```\n\n`View.cshtml`:\n\n```razor\n\u003cimg-asset asset=\"@Model.TeaserImage.First()\" class=\"img-responsive\" default-width=\"300\"\u003e\n  \u003cmedia-condition min-width=\"769\" image-width=\"300\" /\u003e\n  \u003cmedia-condition min-width=\"330\" max-width=\"768\" image-width=\"689\" /\u003e\n\u003c/img-asset\u003e\n```\n\n#### Output\n\n```html\n\u003cimg\n  class=\"img-responsive\"\n  alt=\"Coffee Brewing Techniques\"\n  sizes=\"(min-width: 769px) 300px, (max-width: 768px) and (min-width: 330px) 689px, 300px\"\n  src=\"https://assets-us-01.kc-usercontent.com/975bf280-fd91-488c-994c-2f04416e5ee3/fcbb12e6-66a3-4672-85d9-d502d16b8d9c/which-brewing-fits-you-1080px.jpg?w=2000\"\n  srcset=\"\n    https://assets-us-01.kc-usercontent.com/975bf280-fd91-488c-994c-2f04416e5ee3/fcbb12e6-66a3-4672-85d9-d502d16b8d9c/which-brewing-fits-you-1080px.jpg?w=200   200w,\n    https://assets-us-01.kc-usercontent.com/975bf280-fd91-488c-994c-2f04416e5ee3/fcbb12e6-66a3-4672-85d9-d502d16b8d9c/which-brewing-fits-you-1080px.jpg?w=300   300w,\n    https://assets-us-01.kc-usercontent.com/975bf280-fd91-488c-994c-2f04416e5ee3/fcbb12e6-66a3-4672-85d9-d502d16b8d9c/which-brewing-fits-you-1080px.jpg?w=400   400w,\n    https://assets-us-01.kc-usercontent.com/975bf280-fd91-488c-994c-2f04416e5ee3/fcbb12e6-66a3-4672-85d9-d502d16b8d9c/which-brewing-fits-you-1080px.jpg?w=600   600w,\n    https://assets-us-01.kc-usercontent.com/975bf280-fd91-488c-994c-2f04416e5ee3/fcbb12e6-66a3-4672-85d9-d502d16b8d9c/which-brewing-fits-you-1080px.jpg?w=800   800w,\n    https://assets-us-01.kc-usercontent.com/975bf280-fd91-488c-994c-2f04416e5ee3/fcbb12e6-66a3-4672-85d9-d502d16b8d9c/which-brewing-fits-you-1080px.jpg?w=1000 1000w,\n    https://assets-us-01.kc-usercontent.com/975bf280-fd91-488c-994c-2f04416e5ee3/fcbb12e6-66a3-4672-85d9-d502d16b8d9c/which-brewing-fits-you-1080px.jpg?w=1200 1200w,\n    https://assets-us-01.kc-usercontent.com/975bf280-fd91-488c-994c-2f04416e5ee3/fcbb12e6-66a3-4672-85d9-d502d16b8d9c/which-brewing-fits-you-1080px.jpg?w=1400 1400w,\n    https://assets-us-01.kc-usercontent.com/975bf280-fd91-488c-994c-2f04416e5ee3/fcbb12e6-66a3-4672-85d9-d502d16b8d9c/which-brewing-fits-you-1080px.jpg?w=1600 1600w,\n    https://assets-us-01.kc-usercontent.com/975bf280-fd91-488c-994c-2f04416e5ee3/fcbb12e6-66a3-4672-85d9-d502d16b8d9c/which-brewing-fits-you-1080px.jpg?w=2000 2000w\n  \"\n  title=\"Coffee Brewing Techniques\"\n/\u003e\n```\n\n## Webhooks\n\nPackage provides a model for webhook deserialization: `WebhookNotification`. Legacy webhooks are supported via classes `DeliveryWebhookModel` and `ManagementWebhookModel`, to be used with legacy (preview) delivery API and management API triggers respectively. See [Webhooks reference](https://kontent.ai/learn/reference/webhooks-reference/) in Kontent.ai documentation.\n\n## Middlewares\n\n### Webhook signature verification middleware\n\nThis middleware verifies the `X-Kontent-ai-Signature` (and the legacy `X-KC-Signature`) header. Returns 401 response if the signature is invalid.\n\n`appsettings.json`:\n\n```json\n...\n\"WebhookOptions\": {\n    \"Secret\": \"\u003cyour_secret\u003e\"\n  },\n...\n```\n\n`Startup.cs`:\n\n```csharp\npublic void Configure(IApplicationBuilder app, IWebHostEnvironment env)\n{\n  // Register the validation middleware for any number of controllers that serve for processing webhooks\n  app.UseWebhookSignatureValidator(context =\u003e context.Request.Path.StartsWithSegments(\"/webhooks/webhooks\", StringComparison.OrdinalIgnoreCase), Configuration.GetSection(nameof(WebhookOptions)));\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkontent-ai%2Faspnetcore-extensions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkontent-ai%2Faspnetcore-extensions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkontent-ai%2Faspnetcore-extensions/lists"}