Ebitex.Content.Delivery
1.0.15
Prefix Reserved
dotnet add package Ebitex.Content.Delivery --version 1.0.15
NuGet\Install-Package Ebitex.Content.Delivery -Version 1.0.15
<PackageReference Include="Ebitex.Content.Delivery" Version="1.0.15" />
<PackageVersion Include="Ebitex.Content.Delivery" Version="1.0.15" />
<PackageReference Include="Ebitex.Content.Delivery" />
paket add Ebitex.Content.Delivery --version 1.0.15
#r "nuget: Ebitex.Content.Delivery, 1.0.15"
#:package Ebitex.Content.Delivery@1.0.15
#addin nuget:?package=Ebitex.Content.Delivery&version=1.0.15
#tool nuget:?package=Ebitex.Content.Delivery&version=1.0.15
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 and restricted content is served by the audiences a visitor is in, proved by a signed token. One call asks Content which audiences it uses, asks Audience about exactly those, and returns the token to pass on your Content reads:
builder.Services.AddEbitexAudience(options => options.ApiKey = builder.Configuration["Audience:DeliveryKey"]);
var access = await audience.GetAccessAsync(
delivery, visitorToken, new AudienceConsentSignals(Cmp: "granted"), new ContentContext().Set("buyerType", buyerType));
var result = await delivery.ResolvePathAsync(Request.Path, new PathOptions
{
Context = new ContentContext().Set("buyerType", buyerType),
AudienceToken = access.Token,
});
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. GetAccess never throws: if Audience cannot be
reached Token is null, the page renders as it does for an anonymous visitor and Failure says why (log it). The token
is per visitor, so never put it in a shared cache. Audiences are never sent in the context: Content refuses them there.
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.