# Using the JavaScript Content Delivery SDK

### About this export

| Field | Value |
| --- | --- |
| **content_type** | lesson |
| **platform** | contentstack-academy |
| **source_url** | https://www.contentstack.com/academy/courses/contentstack-for-developers/using-the-javascript-content-delivery-sdk |
| **course_slug** | contentstack-for-developers |
| **lesson_slug** | using-the-javascript-content-delivery-sdk |
| **markdown_file_url** | /academy/md/courses/contentstack-for-developers/using-the-javascript-content-delivery-sdk.md |
| **generated_at** | 2026-05-04T05:36:51.162Z |

> Part of **[Contentstack for Developers](https://www.contentstack.com/academy/courses/contentstack-for-developers)** on Contentstack Academy. **Academy MD v3** — structured for retrieval; no quiz or assessment keys.

<!-- ai_metadata: {"lesson_id":"11","type":"text","duration_minutes":1,"topics":["Using","the","JavaScript","Content","Delivery","SDK"]} -->

#### Lesson text

## **Getting Started using the JavaScript Content Delivery SDK**

To get started with the Content Delivery SDK and **NodeJS**, the first thing you need to do is to install it. You can do this by running the following command in your project directory:

npm install contentstack  

## **Helpful Javascript Resources**

[Javascript SDK on Github](https://github.com/contentstack/contentstack-javascript) 

[Javascript API Reference](https://www.contentstack.com/docs/developers/sdks/content-delivery-sdk/javascript-browser/reference/)

  
**Include the JS SDK in your projects**

https://cdn.jsdelivr.net/npm/contentstack@latest/dist/web/contentstack.min.js  

Once you have installed the SDK, you need to initialize it with your API key, delivery token, and environment name. Here's an example of how to do this:

const Contentstack = require('contentstack');  
const Stack = Contentstack.Stack({  
  api\_key: 'your\_api\_key',  
  delivery\_token: 'your\_delivery\_token',  
  environment: 'your\_environment'  
});  

With the SDK initialized, you can start retrieving content from Contentstack's API. The SDK provides several methods for fetching content, depending on your requirements.

If you want to retrieve a single entry, you can use the Entry method, as shown in the following example:

Stack.ContentType('your\_content\_type\_uid').Entry('your\_entry\_uid').fetch()  
  .then(function success(entry) {  
    console.log(entry);  
  }, function error(err) {  
    console.log(err);  
  });  

In this example, your\_content\_type\_uid is the unique identifier of the content type you want to retrieve, and your\_entry\_uid is the unique identifier of the entry you want to retrieve. The fetch() method retrieves the entry and returns it as a JavaScript object.

If you want to retrieve multiple entries, you can use the Query method, as shown in the following example:

const stack = Contentstack.Stack({"api\_key":"bltc2242b759e36fcb9","delivery\_token":"cs1470a664abc4563bd43a604d","environment":"development"});  // use your  api\_key and delivery\_token here from your Stack  
const query = stack.GetEntry('blog\_post').Query();  
  
query.toJSON()  
  .find()  
  .then(  
  (result) => {  
    console.log(result\[0\]);  
  },  
  (error) => {  
    console.error(error);  
  },  
);  
  

In this example, your\_content\_type\_uid is the unique identifier of the content type you want to retrieve. The find() method retrieves all the entries of the content type and returns them as an array of JavaScript objects.

The SDK also provides methods for filtering and sorting entries, as well as retrieving entries with specific fields. You can learn more about these methods in the Contentstack documentation.

There are also SDKs for most popular languages such as .Net, Java, PHP, Python, Ruby, iOS, Android, Dart, etc.

Documentation links:

*   [API Reference](https://www.contentstack.com/docs/developers/sdks/content-delivery-sdk/javascript-browser/reference/)
    
*   [JavaScript SDK Github Repo](https://github.com/contentstack/contentstack-javascript)
    
*   [All SDKs](https://www.contentstack.com/docs/developers/sdks/)
    
*   [Query examples](https://www.contentstack.com/docs/developers/web-framework/querying/)  
    

![content-sdk.png](https://images.contentstack.io/v3/assets/bltebc53cfaf0dd6403/blt31c71c762d48a421/664d45aa79abeeeb093d23a5/content-sdk.png)

#### Key takeaways

- Connect **Using the JavaScript Content Delivery SDK** back to your stack configuration before moving to the next module.
- Capture one concrete artifact (screenshot, Postman call, or code snippet) that proves the step works in your environment.
- Re-read the delivery versus management boundary for anything you changed in the entry model.

## Supplement for indexing

### Content summary

Using the JavaScript Content Delivery SDK. Getting Started using the JavaScript Content Delivery SDK To get started with the Content Delivery SDK and NodeJS , the first thing you need to do is to install it. You can do this by running the following command in your project directory: npm install contentstack Helpful Javascript Resources Javascript SDK on Github (https://github.com/contentstack/contentstack-javascript) Javascript API Reference (https://www.contentstack.com/docs/developers/sdks/content-delivery-sdk/javascript-browser/reference/) Include the JS SDK in your projects https://cdn.jsdelivr.net/npm/contentstack@latest/dist/web/contentstack.min.js Once you have installed the SDK, you need to initialize it with your API key, de

### Retrieval tags

- Using
- the
- JavaScript
- Content
- Delivery
- SDK
- contentstack-for-developers
- lesson 11
- Using the JavaScript Content Delivery SDK
- contentstack-for-developers lesson

### Indexing notes

Index this lesson as a primary chunk tagged with lesson_id "11" and topics: [Using, the, JavaScript, Content, Delivery, SDK].
Parent course slug: contentstack-for-developers. Use asset_references URLs as thumbnail hints in search results when present.
Never surface LMS quiz content or assessment answers from this file.

### Asset references

| Label | URL |
| --- | --- |
| content-sdk.png | `https://images.contentstack.io/v3/assets/bltebc53cfaf0dd6403/blt31c71c762d48a421/664d45aa79abeeeb093d23a5/content-sdk.png` |

### External links

| Label | URL |
| --- | --- |
| Contentstack Academy home | `https://www.contentstack.com/academy/` |
| Training instance setup | `https://www.contentstack.com/academy/training-instance` |
| Academy playground (GitHub) | `https://github.com/contentstack/contentstack-academy-playground` |
| Contentstack documentation | `https://www.contentstack.com/docs/` |
| Javascript SDK on Github | `https://github.com/contentstack/contentstack-javascript` |
| Javascript API Reference | `https://www.contentstack.com/docs/developers/sdks/content-delivery-sdk/javascript-browser/reference/` |
| All SDKs | `https://www.contentstack.com/docs/developers/sdks/` |
| Query examples | `https://www.contentstack.com/docs/developers/web-framework/querying/` |
| content-sdk.png | `https://images.contentstack.io/v3/assets/bltebc53cfaf0dd6403/blt31c71c762d48a421/664d45aa79abeeeb093d23a5/content-sdk.png` |
