@kontent-ai/smart-link
Version:
Kontent.ai Smart Link SDK allowing to automatically inject [smart links](https://docs.kontent.ai/tutorials/develop-apps/build-strong-foundation/set-up-editing-from-preview#a-using-smart-links) to Kontent.ai according to manually specified [HTML data attri
30 lines (29 loc) • 1.14 kB
TypeScript
export type BuildItemLinkParams = {
environmentId: string;
languageCodename: string;
itemId: string;
};
export type BuildElementLinkParams = {
environmentId: string;
languageCodename: string;
itemId: string;
elementCodename: string;
};
export type BuildComponentElementLinkParams = {
environmentId: string;
languageCodename: string;
itemId: string;
contentComponentId: string;
componentElementCodename: string;
};
export type BuildKontentElementLinkParams = BuildElementLinkParams | BuildComponentElementLinkParams;
/**
* Builds a URL that opens the specified content item in the Kontent.ai web application editor.
*/
export declare function buildKontentItemLink(params: BuildItemLinkParams): string;
/**
* Builds a URL that opens a specific element within a content item in the Kontent.ai web application editor.
* This function can handle both regular content elements and elements within content components.
* If an element is within a component, 'contentComponentId' must be provided.
*/
export declare function buildKontentElementLink(data: BuildKontentElementLinkParams): string;