kontent-ai / delivery-sdk-net

Kontent.ai Delivery .NET SDK
https://www.nuget.org/packages/Kontent.Ai.Delivery
MIT License
32 stars 43 forks source link

Add support for custom asset domains #311

Open Suzii opened 2 years ago

Suzii commented 2 years ago

Motivation

Customers want to use their own domains in asset links instead of the default Kontent asset URL. This way the links on their webpage will look more trustworthy, and since the custom links will be visible in search engine results, it also helps SEO optimization. We will implement the support for custom asset domains in the Kontent app BE and Deliver, but for the whole solution to work, we also need the support in the SDK.

Proposed solution

We would like to add a new item to SDK configuration - custom asset domain. The customer would be able to set the domain. When the customer gets the item/variant that contains an asset (in Asset element or Rich text element), the custom domain will be used in the link instead of the default Kontent domain. The rest of the URL will stay the same. Example: https://test15641652.assets.com/3727c9f0-9ea0-0068-2d4f-e6cdb4acff9d/1e040cde-e4be-4dac-a006-d406e40abf56/cat3.jpg instead of https://qa-assets-eu-01.freetls.fastly.net/3727c9f0-9ea0-0068-2d4f-e6cdb4acff9d/1e040cde-e4be-4dac-a006-d406e40abf56/cat3.jpg

Additional context

Release date: the BE part of the solution is done, you can release the SDK changes as soon as they are ready.

Feel free to be inspired by already implemented JS SDK:

xantari commented 2 days ago

Related: #193