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 .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ VITE_CONTENTSTACK_API_KEY=your_api_key_here
VITE_CONTENTSTACK_DELIVERY_TOKEN=your_delivery_token_here
VITE_CONTENTSTACK_PREVIEW_TOKEN=your_preview_token_here
VITE_CONTENTSTACK_ENVIRONMENT=preview
VITE_CONTENTSTACK_REGION=EU # Options: EU or NA
VITE_CONTENTSTACK_REGION=EU # Options: NA, EU, AU, AZURE-NA, AZURE-EU, GCP-NA, GCP-EU
VITE_CONTENTSTACK_PREVIEW=true # Set to true to enable preview
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,48 @@ NEXT_PUBLIC_CONTENTSTACK_ENVIRONMENT=preview
NEXT_PUBLIC_CONTENTSTACK_PREVIEW=true
```

## Regions and endpoint configuration

Set `VITE_CONTENTSTACK_REGION` to the region your Contentstack account is on. The value is case-insensitive.

| Region | Value |
|---|---|
| AWS North America | `NA` or `US` |
| AWS Europe | `EU` |
| AWS Australia | `AU` |
| Azure North America | `AZURE-NA` |
| Azure Europe | `AZURE-EU` |
| GCP North America | `GCP-NA` |
| GCP Europe | `GCP-EU` |

> 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.

All API endpoints (content delivery, live preview, Visual Builder) are automatically resolved from your region. You do not need to set them manually.

The following endpoint keys are resolved per region and available if you ever need them directly via `getContentstackEndpoint` from `@contentstack/utils`:

| Key | NA value |
|---|---|
| `contentDelivery` | `cdn.contentstack.io` |
| `preview` | `rest-preview.contentstack.com` |
| `application` | `app.contentstack.com` |
| `graphqlDelivery` | `graphql.contentstack.com` |
| `graphqlPreview` | `graphql-preview.contentstack.com` |
| `images` | `images.contentstack.io` |
| `assets` | `assets.contentstack.io` |
| `contentManagement` | `api.contentstack.io` |
| `auth` | `auth-api.contentstack.com` |

### Custom or dedicated environments

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.**

```bash
VITE_CONTENTSTACK_CONTENT_DELIVERY=your-custom-cdn.example.com
VITE_CONTENTSTACK_PREVIEW_HOST=your-custom-preview.example.com
VITE_CONTENTSTACK_CONTENT_APPLICATION=your-custom-app.example.com
```

## Turn on Live Preview

Go to Settings > Live Preview. Click enable and select the `Preview` environment in the drop down. Hit save.
Expand Down
100 changes: 14 additions & 86 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kickstart-react",
"version": "0.0.14",
"version": "0.1.0",
"private": false,
"repository": {
"type": "git",
Expand All @@ -24,10 +24,10 @@
"dependencies": {
"@contentstack/delivery-sdk": "^5.2.1",
"@contentstack/live-preview-utils": "^4.4.4",
"@timbenniks/contentstack-endpoints": "^2.1.0",
"dompurify": "^3.4.10",
"@contentstack/utils": "^1.9.1",
"dompurify": "^3.4.11",
"react": "^19.2.7",
"react-dom": "^19.2.7"
"react-dom": "^19.2.6"
},
"devDependencies": {
"@eslint/js": "^9.39.4",
Expand Down
Loading
Loading