Ebitex.Content.Delivery
1.0.8
Prefix Reserved
See the version list below for details.
dotnet add package Ebitex.Content.Delivery --version 1.0.8
NuGet\Install-Package Ebitex.Content.Delivery -Version 1.0.8
<PackageReference Include="Ebitex.Content.Delivery" Version="1.0.8" />
<PackageVersion Include="Ebitex.Content.Delivery" Version="1.0.8" />
<PackageReference Include="Ebitex.Content.Delivery" />
paket add Ebitex.Content.Delivery --version 1.0.8
#r "nuget: Ebitex.Content.Delivery, 1.0.8"
#:package Ebitex.Content.Delivery@1.0.8
#addin nuget:?package=Ebitex.Content.Delivery&version=1.0.8
#tool nuget:?package=Ebitex.Content.Delivery&version=1.0.8
Ebitex.Content.Delivery
A server-side .NET client for the ebitex Content Delivery API: resolve a page by its address, fetch components, query streams and their facets, read the navigation tree, build a sitemap, and read a live-preview draft.
It is the .NET counterpart of the server half of @ebitex/content-sdk. It does no rendering, holds no
cache, and depends on nothing beyond Microsoft.Extensions.Http and Microsoft.Extensions.Options.
Configure
Use a server-side delivery key (Content → Configure → Delivery), never a browser-safe one: a
server sends no Origin, so a browser-safe key is refused.
builder.Services.AddEbitexContentDelivery(options =>
{
options.ApiKey = builder.Configuration["Content:DeliveryKey"];
options.SiteId = Guid.Parse(builder.Configuration["Content:SiteId"]!);
});
SiteId is required in practice: the API cannot infer your site from a server's request.
Resolve a page
var result = await delivery.ResolvePathAsync(Request.Path, new PathOptions
{
Context = new ContentContext().Set("buyerType", buyerType),
IncludeReferencePaths = true,
});
return result switch
{
PathResult.Presentation page => View(page),
PathResult.Redirect redirect => RedirectPermanentPreserveMethod(redirect.TargetPath!),
_ => NotFound(),
};
Send the path exactly as your site received it. On a site that carries the locale in its addresses
(/fr/cafes) the server reads it from the path; under per-host locales pass PathOptions.Host.
Know the visitor's audiences
Personalized content asks for an audience by id. Ask Audience which ones a visitor is in, from your presentation app, then pass the answer to Content in the context:
builder.Services.AddEbitexAudience(options => options.ApiKey = builder.Configuration["Audience:DeliveryKey"]);
var audiences = await audience.ResolveAsync(
new ContentContext().Set("buyerType", buyerType), visitorToken, new AudienceConsentSignals(Cmp: "granted"));
var result = await delivery.ResolvePathAsync(Request.Path, new PathOptions
{
Context = new ContentContext().Set("buyerType", buyerType).Audiences(audiences),
});
An Audience delivery key is its own kind (a Content key does not work) and, on a server, should be one with no
origin or IP restriction. visitorToken and the consent signals are optional: without them, or without consent
granted on that device, the answer is decided by the context alone and says why in Reason. Content never calls
Audience; this call is yours, once when a session starts and again on each route change.
Sitemap
var data = await delivery.GetSitemapAsync();
var documents = SitemapBuilder.BuildDocuments(data, new SitemapDocumentsOptions { Origin = "https://example.com" });
One document when the site fits the protocol's caps, otherwise an index plus shards, each to be
served at its own Path.
Full guide: developers.ebitex.io.
Worked examples: the ebitex samples repository has complete sites built against the same Delivery API, each with the content model it expects.
| 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.Http (>= 10.0.0)
- Microsoft.Extensions.Options (>= 10.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.