Skip to content

contentstack/contentstack-js-core

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@contentstack/core

Contentstack

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/core

Then 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 install

Build

Build all output formats (CommonJS, ESM, UMD, and TypeScript declarations):

npm run build

Build 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 declarations

Testing

Run unit tests:

npm run test

Run linting:

npm run lint

Packaging

Create a package tarball:

npm run package

Clean

Clean build artifacts:

npm run clean

License

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.

About

Core library for Contentstack Js SDK

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 10