Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .talismanrc
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ fileignoreconfig:
- filename: src/sdk/utils.ts
checksum: 00fb0674684ede99467f5d77012d92136481d54c75894768646e58703ae0fa5a
- filename: src/sdk/entry.ts
checksum: 33b8aa8ad61a79911b22c61b418094034b308ca96bdebdc2619398337433fa1d
checksum: 4f8b6df5fa08a66e57286a0dd69d1b49064f7f4540a627e8fa63730b6ee9cbf3
version: "1.0"
28 changes: 15 additions & 13 deletions src/sdk/entry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,21 @@ if (customHostBaseUrl && isValidCustomHostUrl(customHostBaseUrl)) {
Stack.setHost(customHostBaseUrl);
}

// Setting LP if enabled
ContentstackLivePreview.init({
//@ts-ignore
stackSdk: Stack,
enable: ENV.LIVE_PREVIEW === "true",
mode: "builder",
stackDetails: {
apiKey: ENV.API_KEY,
},
clientUrlParams:{
host: ENV.APP_HOST
}
})?.catch((error) => console.error(error));
if (ENV.LIVE_PREVIEW === "true") {
// Setting LP if enabled
ContentstackLivePreview.init({
//@ts-ignore
stackSdk: Stack,
enable: ENV.LIVE_PREVIEW === "true",
mode: "builder",
stackDetails: {
apiKey: ENV.API_KEY,
},
clientUrlParams: {
host: ENV.APP_HOST
}
})?.catch((error) => console.error(error));
}


export const { onEntryChange } = ContentstackLivePreview;
Expand Down
4 changes: 2 additions & 2 deletions src/sdk/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const isBasicConfigValid = () => {
// Live preview config validation
export const isLpConfigValid = () => {
return (
!!ENV.LIVE_PREVIEW &&
ENV.LIVE_PREVIEW === "true" &&
!!ENV.PREVIEW_TOKEN &&
!!ENV.PREVIEW_HOST &&
!!ENV.APP_HOST
Expand Down Expand Up @@ -75,7 +75,7 @@ export const initializeContentStackSdk = (): Stack => {
};

// api host url
export const customHostUrl = (baseUrl=''): string => {
export const customHostUrl = (baseUrl = ''): string => {
return baseUrl.replace("api", "cdn");
};

Expand Down
Loading