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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### Version: 4.11.1
#### Date: feb-09-2026
Fix: Fix security issues

### Version: 4.11.0
#### Date: Jan-19-2026
Enhancement: Integrated getContentstackEndpoint method of Utils SDK for endpoint selection
Expand Down
57 changes: 57 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,63 @@ You will need to specify the API key, Delivery Token, and Environment Name of yo

Once you have initialized the SDK, you can start getting content in your app.

#### Region and Host Configuration

The SDK supports region and custom host configuration to connect to different Contentstack data centers or custom endpoints.

**Region Support**

You can specify a region to connect to the appropriate Contentstack data center. Available regions are:
- `US` (default) - Uses `cdn.contentstack.io`
- `EU` - Uses `eu-cdn.contentstack.com`
- `AU` - Uses `au-cdn.contentstack.com`
- `AZURE_NA` - Uses `azure-na-cdn.contentstack.com`
- `AZURE_EU` - Uses `azure-eu-cdn.contentstack.com`
- `GCP_NA` - Uses `gcp-na-cdn.contentstack.com`
- `GCP_EU` - Uses `gcp-eu-cdn.contentstack.com`

```typescript
import contentstack, { Region } from '@contentstack/delivery-sdk'

// Using region enum
const stack = contentstack.stack({
apiKey: "apiKey",
deliveryToken: "deliveryToken",
environment: "environment",
region: Region.EU
});

// Using region string
const stack = contentstack.stack({
apiKey: "apiKey",
deliveryToken: "deliveryToken",
environment: "environment",
region: "eu"
});
```

**Custom Host Support**

You can specify a custom host to connect to a custom endpoint. If a custom host is provided, it takes priority over the region-based host.

```typescript
const stack = contentstack.stack({
apiKey: "apiKey",
deliveryToken: "deliveryToken",
environment: "environment",
host: "custom-cdn.example.com"
});

// Custom host with region (host takes priority)
const stack = contentstack.stack({
apiKey: "apiKey",
deliveryToken: "deliveryToken",
environment: "environment",
region: Region.EU,
host: "custom-cdn.example.com"
});
```

#### Querying content from your stack

To get a single entry, you need to specify the content type as well as the ID of the entry.
Expand Down
93 changes: 19 additions & 74 deletions package-lock.json

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

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@contentstack/delivery-sdk",
"version": "4.11.0",
"version": "4.11.1",
"type": "module",
"license": "MIT",
"main": "./dist/legacy/index.cjs",
Expand Down Expand Up @@ -47,8 +47,8 @@
"prerelease": "npm run test:all && npm run validate:all"
},
"dependencies": {
"@contentstack/core": "^1.3.6",
"@contentstack/utils": "^1.6.3",
"@contentstack/core": "^1.3.9",
"@contentstack/utils": "^1.7.0",
"axios": "^1.13.1",
"humps": "^2.0.1"
},
Expand Down