Contentstack's TypeScript Delivery SDK lets you harness the power of Contentstack by utilizing the Content Delivery APIs to efficiently fetch and deliver content to your TypeScript-based applications. In our comprehensive tutorials and guides, you will find valuable information on the various tools and integrations supported by Contentstack, along with TypeScript SDK example apps, empowering you to kickstart your project with ease.
Note: The Contentstack TypeScript SDK supports Node.js 22 or later.
To integrate your TypeScript application with Contentstack’s TypeScript Delivery SDK, follow the steps mentioned in the Get Started with Typescript Delivery SDK documentation.
Here are some of the key features of the TypeScript SDK:
RTE support: The Typescript Delivery SDK allows you to retrieve embedded entries and assets that are stored in the Rich Text Editor (RTE) field.
Here is an example of how you can start using the TypeScript Delivery SDK.
To initialize the SDK and import its library into your system, execute the following command:
import contentstack from '@contentstack/delivery-sdk'Next, you need to create a stack instance that is a repository that holds all your content and where you want to perform all your operations.
To do so, execute the following command:
const stack = contentstack.stack({ apiKey: "apiKey", deliveryToken: "deliveryToken", environment: "environment" });Once you have access to the stack instance, you can execute any query.
For example, to retrieve details for a particular asset, execute the following command and enter the UID of the asset..
const result = stack.asset('asset_uid').includeDimension().fetch<Asset>();