---
title: "Environment"
description: "Environment"
url: "https://www.contentstack.com/docs/developers/sdks/content-management-sdk/javascript/reference/environment"
product: "Contentstack"
doc_type: "guide"
audience:
  - developers
  - admins
version: "current"
last_updated: "2026-09-04"
---

# Environment

## Environment

A publishing [environment](/docs/headless-cms/about-environments/) corresponds to one or more deployment servers or a content delivery destination where the entries need to be published.

## update

The Update Environment call lets you update the name and description of an existing Environment.

```
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })

client.stack({ api_key: 'api_key'}).environment('name')
.fetch()
.then((environment) => {
 environment.title = 'My New Content Type'
 environment.description = 'Content Type description'
 return environment.update()
})
.then((environment) => console.log(environment))
```

## delete

The Delete Environment call is used to delete an existing Environment permanently from your Stack.

```
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })

client.stack({ api_key: 'api_key'}).environment('name')
.delete()
.then((response) => console.log(response.notice))
```

## fetch

The fetch Environment call fetches Environment details.

```
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })

client.stack({ api_key: 'api_key'}).environment('name')
.fetch()
.then((environment) => console.log(environment))
```

## create

The Create a Environment call creates a new environment in a particular stack of your Contentstack account.

```
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })

const environment = {
     name: 'development',
     servers: [
               {
                 name: 'default'
               }
               ],
     urls: [
             {
                 locale: 'en-us',
                 url: 'http://example.com/'
             }
           ],
     deploy_content: true
}

client.stack({ api_key: 'api_key'}).environment().create({ environment })
.then((environment) => console.log(environment))
```

The environment details with name, server, urls, and deploy content.

## query

The Query on Environment will allow to fetch details of all or specific Environment.

```
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })

client.stack({ api_key: 'api_key'}).environment()
.query({ query: { name: 'Environment Name' } }).find()
.then((environment) => console.log(environment))
```

The \`include\_count’ parameter includes the count of total number of environment in your stack, along with the details of each environment.

The ‘limit’ parameter will return a specific number of environment in the output.

The ‘skip’ parameter will skip a specific number of environment in the response.

## Environment | JavaScript Management SDK | Contentstack

Environment maps to deployment servers or delivery destinations where your published entries are served in the JavaScript Management SDK.