Skip to content

Commit 76aaa58

Browse files
Merge pull request #52 from contentstack/enh/dx-8592
enhc: replace @timbenniks/contentstack-endpoints with @contentstack/utils
2 parents 3ec6d59 + 6fffe37 commit 76aaa58

5 files changed

Lines changed: 72 additions & 103 deletions

File tree

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ VITE_CONTENTSTACK_API_KEY=your_api_key_here
44
VITE_CONTENTSTACK_DELIVERY_TOKEN=your_delivery_token_here
55
VITE_CONTENTSTACK_PREVIEW_TOKEN=your_preview_token_here
66
VITE_CONTENTSTACK_ENVIRONMENT=preview
7-
VITE_CONTENTSTACK_REGION=EU # Options: EU or NA
7+
VITE_CONTENTSTACK_REGION=EU # Options: NA, EU, AU, AZURE-NA, AZURE-EU, GCP-NA, GCP-EU
88
VITE_CONTENTSTACK_PREVIEW=true # Set to true to enable preview

README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,48 @@ NEXT_PUBLIC_CONTENTSTACK_ENVIRONMENT=preview
7373
NEXT_PUBLIC_CONTENTSTACK_PREVIEW=true
7474
```
7575

76+
## Regions and endpoint configuration
77+
78+
Set `VITE_CONTENTSTACK_REGION` to the region your Contentstack account is on. The value is case-insensitive.
79+
80+
| Region | Value |
81+
|---|---|
82+
| AWS North America | `NA` or `US` |
83+
| AWS Europe | `EU` |
84+
| AWS Australia | `AU` |
85+
| Azure North America | `AZURE-NA` |
86+
| Azure Europe | `AZURE-EU` |
87+
| GCP North America | `GCP-NA` |
88+
| GCP Europe | `GCP-EU` |
89+
90+
> Not sure which region you're on? Check your Contentstack dashboard URL — `eu-app.contentstack.com` means EU, `app.contentstack.com` means NA. Free developer accounts are on EU.
91+
92+
All API endpoints (content delivery, live preview, Visual Builder) are automatically resolved from your region. You do not need to set them manually.
93+
94+
The following endpoint keys are resolved per region and available if you ever need them directly via `getContentstackEndpoint` from `@contentstack/utils`:
95+
96+
| Key | NA value |
97+
|---|---|
98+
| `contentDelivery` | `cdn.contentstack.io` |
99+
| `preview` | `rest-preview.contentstack.com` |
100+
| `application` | `app.contentstack.com` |
101+
| `graphqlDelivery` | `graphql.contentstack.com` |
102+
| `graphqlPreview` | `graphql-preview.contentstack.com` |
103+
| `images` | `images.contentstack.io` |
104+
| `assets` | `assets.contentstack.io` |
105+
| `contentManagement` | `api.contentstack.io` |
106+
| `auth` | `auth-api.contentstack.com` |
107+
108+
### Custom or dedicated environments
109+
110+
If your Contentstack account runs on a dedicated or private cloud instance, the standard region-based endpoints may not apply. In that case, override each endpoint individually using these environment variables. **Only set these if instructed by Contentstack support — standard accounts should leave them unset.**
111+
112+
```bash
113+
VITE_CONTENTSTACK_CONTENT_DELIVERY=your-custom-cdn.example.com
114+
VITE_CONTENTSTACK_PREVIEW_HOST=your-custom-preview.example.com
115+
VITE_CONTENTSTACK_CONTENT_APPLICATION=your-custom-app.example.com
116+
```
117+
76118
## Turn on Live Preview
77119

78120
Go to Settings > Live Preview. Click enable and select the `Preview` environment in the drop down. Hit save.

package-lock.json

Lines changed: 14 additions & 86 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "kickstart-react",
3-
"version": "0.0.14",
3+
"version": "0.1.0",
44
"private": false,
55
"repository": {
66
"type": "git",
@@ -24,10 +24,10 @@
2424
"dependencies": {
2525
"@contentstack/delivery-sdk": "^5.2.1",
2626
"@contentstack/live-preview-utils": "^4.4.4",
27-
"@timbenniks/contentstack-endpoints": "^2.1.0",
28-
"dompurify": "^3.4.10",
27+
"@contentstack/utils": "^1.9.1",
28+
"dompurify": "^3.4.11",
2929
"react": "^19.2.7",
30-
"react-dom": "^19.2.7"
30+
"react-dom": "^19.2.6"
3131
},
3232
"devDependencies": {
3333
"@eslint/js": "^9.39.4",

0 commit comments

Comments
 (0)