Skip to content

Commit 9fb1e6a

Browse files
authored
Merge pull request #31 from contentstack/fix/DX-1009-livepreview-remove-hardcoded-endpoints
fix: fix: remove hardcoded endpoints
2 parents 8d3779f + 9495468 commit 9fb1e6a

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
## Change log
22

3+
### Version: 4.0.5
4+
#### Date: July-30-2024
5+
Fix: Live preview endpoint issue
6+
37
### Version: 4.0.5
48
#### Date: July-23-2024
59
Dependecy updates

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@contentstack/delivery-sdk",
3-
"version": "4.0.5",
3+
"version": "4.0.6",
44
"type": "commonjs",
55
"main": "./dist/cjs/src/index.js",
66
"types": "./dist/types/src/index.d.ts",

src/lib/contentstack.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,9 @@ export function stack(config: StackConfig): StackClass {
4242

4343
if (config.live_preview?.enable === true) {
4444
if (config.live_preview?.management_token != null && config.live_preview?.preview_token == null) {
45-
config.host = 'api.contentstack.io'
46-
config.live_preview.host = config.host
45+
config.host = config.live_preview.host
4746
} else if (config.live_preview?.preview_token != null && config.live_preview?.management_token == null) {
48-
config.host = 'rest-preview.contentstack.com'
49-
config.live_preview.host = config.host
47+
config.host = config.live_preview.host
5048
}
5149
} else {
5250
defaultConfig.defaultHostname = config.host ? config.host : getHost(config.region, config.host);

0 commit comments

Comments
 (0)