Skip to content

Commit 265baf7

Browse files
authored
Merge pull request #76 from contentstack/fix/custom-host-api
fix: for custom host api
2 parents 8e127e0 + ff02677 commit 265baf7

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/sdk/entry.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ const {
2323
REACT_APP_CONTENTSTACK_API_HOST,
2424
} = process.env;
2525

26-
const customHostBaseUrl = customHostUrl(
26+
const customHostBaseUrl = REACT_APP_CONTENTSTACK_API_HOST? customHostUrl(
2727
REACT_APP_CONTENTSTACK_API_HOST as string
28-
);
28+
): "";
2929

3030
// SDK initialization
3131
const Stack = initializeContentStackSdk();
3232

3333
// set host url only for custom host or non prod base url's
34-
if (isValidCustomHostUrl(customHostBaseUrl)) {
34+
if (customHostBaseUrl && isValidCustomHostUrl(customHostBaseUrl)) {
3535
Stack.setHost(customHostBaseUrl);
3636
}
3737

0 commit comments

Comments
 (0)