enh: replace @timbenniks/contentstack-endpoints with @contentstack/utils - #73
Conversation
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
✅ BUILD PASSED - All security checks passed |
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
✅ BUILD PASSED - All security checks passed |
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
✅ BUILD PASSED - All security checks passed |
enh: replace @timbenniks/contentstack-endpoints with @contentstack/utils
Summary
@timbenniks/contentstack-endpoints(third-party) withgetContentstackEndpointfrom@contentstack/utils(official Contentstack package) for region-to-endpoint resolution@timbenniks/contentstack-endpointsas a direct dependency frompackage.jsonlib/contentstack.ts.env.examplewith all valid region optionsWhat changed and why
lib/contentstack.tsBefore:
After:
Key improvements:
getContentstackEndpointhandles all alias normalisation internally (NA,na,US,usall resolve correctly)&&null-guard is removed —getContentstackEndpointthrows on an invalid region at startup (fail-fast) instead of silently returningundefinedand causing a downstream SDK errorregion ? region : ...ternary is removed —host:in the SDK config takes precedence overregionat runtime, so passing the raw env var string is equivalentpackage.jsonRemoved
@timbenniks/contentstack-endpointsas a direct dependency.@contentstack/utilswas already part of the Contentstack ecosystem and is the officially supported package.README.mdAdded a Regions and endpoint configuration section covering:
.env.exampleUpdated the region line with all valid region options as an inline comment:
Files changed
lib/contentstack.tspackage.json@timbenniks/contentstack-endpointsdirect dependencypackage-lock.jsonnpm installREADME.md.env.exampleNo breaking changes
NEXT_PUBLIC_CONTENTSTACK_REGION,NEXT_PUBLIC_CONTENTSTACK_CONTENT_DELIVERY, etc.)lib/contentstack.tsis the only logic file touched — all components and page routes are untouched