kontent-ai / kontent-ai/java-packages

Add support for custom asset domains

Open
#134 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
17
Forks
27
PR merge metrics
No merged PRs in 30d

Description

### 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:
- issue https://github.com/Kentico/kontent-delivery-sdk-js/issues/333
- merged PR https://github.com/Kentico/kontent-delivery-sdk-js/commit/2e5ae06b689da9da2d8d01ae59f00892e43fde39

Contributor guide

Open the contributing guide

Research direction

Start by locating the SDK configuration and the asset URL handling for Asset and Rich text elements. Use the referenced JavaScript SDK issue and merged commit as implementation context, then verify that a configured custom domain replaces only the default asset host while preserving the rest of each URL. Add or update coverage for both asset forms before release.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, developer-experience
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.