You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Added `Endpoint::getContentstackEndpoint()` for dynamic region-aware URL resolution
4
+
- Added `Utils::getContentstackEndpoint()` proxy for backward-compatible access
5
+
- Bundled `regions.json` is now downloaded at `composer install` / `composer update` via `post-install-cmd`; the file is not committed to the repository
6
+
- Added runtime fallback in `Endpoint::loadRegions()` — downloads `regions.json` on first use when the file is absent (e.g. when the package is installed as a dependency)
7
+
- Added `composer refresh-regions` script to manually pull the latest regions from Contentstack
8
+
- Supports 7 regions (AWS NA/EU/AU, Azure NA/EU, GCP NA/EU) and 18 service endpoint keys
Copy file name to clipboardExpand all lines: README.md
+239Lines changed: 239 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -169,4 +169,243 @@ use Contentstack\Utils\Model\Option;
169
169
...
170
170
$render_html_text = GQL::jsonToHtml($entry->rich_text_content,, new Option());
171
171
...
172
+
```
173
+
174
+
---
175
+
176
+
## Endpoint Resolution
177
+
178
+
The SDK ships with a built-in endpoint resolver that returns the correct Contentstack API URL for any region and any service — no hardcoded URLs needed.
179
+
180
+
### How `regions.json` is provisioned
181
+
182
+
`regions.json` is **not committed** to your project. It is downloaded automatically:
183
+
184
+
| When | How |
185
+
|---|---|
186
+
|`composer install` or `composer update`|`post-install-cmd` runs `scripts/download-regions.php`|
187
+
| First call to `getContentstackEndpoint()` when file is missing | Runtime fallback downloads and caches the file |
188
+
| Manual refresh |`composer refresh-regions`|
189
+
190
+
```sh
191
+
# Refresh when Contentstack adds new regions or services
192
+
composer refresh-regions
193
+
```
194
+
195
+
---
196
+
197
+
### `getContentstackEndpoint()`
198
+
199
+
Available on both `Endpoint` and `Utils` (identical behaviour):
0 commit comments