From febc642192d7e7a6d62431c11be731ff121f750a Mon Sep 17 00:00:00 2001 From: sunil-lakshman <104969541+sunil-lakshman@users.noreply.github.com> Date: Fri, 23 Jan 2026 15:56:17 +0530 Subject: [PATCH 1/2] updated readme file with host and region support document --- README.md | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/README.md b/README.md index 5dbc5ca8..a96499f7 100644 --- a/README.md +++ b/README.md @@ -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" // This will be used instead of eu-cdn.contentstack.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. From 2789cdfd07aef4d5fcdda87ddc7afa8c03bd8b15 Mon Sep 17 00:00:00 2001 From: sunil-lakshman <104969541+sunil-lakshman@users.noreply.github.com> Date: Fri, 23 Jan 2026 15:58:29 +0530 Subject: [PATCH 2/2] remove commented line --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a96499f7..5e8ec2b7 100644 --- a/README.md +++ b/README.md @@ -119,7 +119,7 @@ const stack = contentstack.stack({ deliveryToken: "deliveryToken", environment: "environment", region: Region.EU, - host: "custom-cdn.example.com" // This will be used instead of eu-cdn.contentstack.com + host: "custom-cdn.example.com" }); ```