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
@contentstack/utils (contentstack-utils-javascript) is a JavaScript/TypeScript utilities library for Contentstack. It is not the Content Delivery API (CDA) SDK or the Content Management API (CMA) SDK. It focuses on JSON RTE / Supercharged RTE rendering (jsonToHTML), embedded entry and asset rendering (render, renderContent), GraphQL-oriented helpers (GQL, updateAssetURLForGQL), Live Preview–style editable tags (addEditableTags / addTags), and region endpoint lookup (getContentstackEndpoint). Typical usage is alongside the Delivery SDK (see repository README.md examples with @contentstack/delivery-sdk).
Runs pretest → build, then Jest with coverage; outputs under reports/
npm run test:debug
Jest watch, in-band
npm run format
Prettier on src/**/*.ts
npm run download-regions
Fetches regions.json only (used by prebuild)
Tests: Unit tests only, under __test__/**/*.test.ts, with mocks in __test__/mock/. There are no live/integration tests requiring stack credentials in this repository.
Credentials / environment
Unit tests: No API keys or .env required.
Build:download-regions calls a public URL (artifacts.contentstack.com); offline builds may warn and rely on an existing src/assets/regions.json. Note regions.json is listed in .gitignore; clones may need a successful npm run build (or manual file) before tests pass.