@contentstack/core
v1.3.9
Published
[](https://www.contentstack.com/)
Readme
@contentstack/core
TypeScript Core SDK for Contentstack - A foundational library providing core modules and utilities for Contentstack TypeScript SDKs.
About Contentstack
Contentstack is a headless CMS with an API-first approach. It is a CMS that developers can use to build powerful cross-platform applications in their favorite languages. Build your application frontend, and Contentstack will take care of the rest. Read More.
Description
This package contains core modules and utilities used by the Contentstack TypeScript Delivery SDK. It provides essential functionality including HTTP client configuration, error handling, request management, parameter serialization, and retry policies.
Features
- HTTP Client: Configurable Axios-based HTTP client with support for custom adapters
- Error Handling: Comprehensive error classes for API and Contentstack-specific errors
- Request Management: Request handling with interceptors and custom error callbacks
- Parameter Serialization: Custom parameter serialization for API requests
- Retry Policies: Built-in retry logic for handling rate limits and transient errors
- TypeScript Support: Full TypeScript definitions included
- Multiple Build Formats: Supports CommonJS, ESM, UMD, and TypeScript declarations
Important Note
This package is an internal dependency used by Contentstack TypeScript SDKs. End users should not install this package directly. Instead, install the appropriate Contentstack SDK (e.g., Contentstack TypeScript Delivery SDK), which will automatically include this package as a dependency.
For SDK Developers
If you are developing or maintaining a Contentstack SDK and need to use this core package directly, you can install it as a dependency:
npm install @contentstack/coreThen import the modules:
import {
httpClient,
// ... other exports
} from '@contentstack/core';Development
Prerequisites
- Node.js version 4.4.7 or later
Setup
Clone the repository and install dependencies:
git clone https://github.com/contentstack/contentstack-js-core.git
cd contentstack-js-core
npm installBuild
Build all output formats (CommonJS, ESM, UMD, and TypeScript declarations):
npm run buildBuild specific formats:
npm run build # Build all
npm run build:cjs # CommonJS
npm run build:esm # ES Modules
npm run build:umd # UMD
npm run build:types # TypeScript declarationsTesting
Run unit tests:
npm run testRun linting:
npm run lintPackaging
Create a package tarball:
npm run packageClean
Clean build artifacts:
npm run cleanLicense
This project is licensed under the MIT License. See the LICENSE.txt file for details.
Repository
Related Projects
Support
For issues and feature requests, please visit the GitHub Issues page.
Copyright (c) 2016-2025 Contentstack. All rights reserved.

