[](https://www.contentstack.com/)
npm install @contentstack/core
TypeScript Core SDK for Contentstack - A foundational library providing core modules and utilities for Contentstack TypeScript SDKs.
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.
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.
- 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
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.
If you are developing or maintaining a Contentstack SDK and need to use this core package directly, you can install it as a dependency:
``bash`
npm install @contentstack/core
Then import the modules:
`typescript`
import {
httpClient,
// ... other exports
} from '@contentstack/core';
- Node.js version 4.4.7 or later
Clone the repository and install dependencies:
`bash`
git clone https://github.com/contentstack/contentstack-js-core.git
cd contentstack-js-core
npm install
Build all output formats (CommonJS, ESM, UMD, and TypeScript declarations):
`bash`
npm run build
Build specific formats:
`bash`
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 declarations
Run unit tests:
`bash`
npm run test
Run linting:
`bash`
npm run lint
Create a package tarball:
`bash`
npm run package
Clean build artifacts:
`bash``
npm run clean
This project is licensed under the MIT License. See the LICENSE.txt file for details.
- GitHub: contentstack/contentstack-js-core
- Contentstack TypeScript Delivery SDK
For issues and feature requests, please visit the GitHub Issues page.
---
Copyright (c) 2016-2025 Contentstack. All rights reserved.