---
title: "Stack"
description: "Stack"
url: "https://www.contentstack.com/docs/developers/sdks/content-delivery-sdk/dart/reference/stack"
product: "Contentstack"
doc_type: "guide"
audience:
  - developers
  - admins
version: "current"
last_updated: "2026-09-13"
---

# Stack

## Stack

Stack an instance of ContentType, asset, assetQuery, and sync

## syncToken

In this API request, you need to provide the sync\_token that you received in the last complete sync process. If there are more than 100 records, you will get a pagination\_token instead

```
import Contentstack

final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
var response = stack.syncToken("syncToken")
```

sync token fetches only the content that was added after your last sync

## sync

The Sync API takes care of syncing your Contentstack data with your app and ensures that the data is always up-to-date by providing delta updates.

```
import Contentstack

final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
var response = stack.sync("contentTypeUid", "fromDate", "locale", PublishType.Entry_Published)
```

content type UID. e.g., products This retrieves published entries of specified content type.

Enter the start date. e.g., **2018-08-14T00:00:00.000Z** This retrieves published entries starting from a specific date

Enter locale code. e.g., **en-us** This retrieves published entries of the specific locale

Applicable values are:

*   entry\_published
*   asset\_published
*   entry\_unpublished
*   asset\_unpublished
*   entry\_deleted
*   asset\_deleted
*   content\_type\_deleted

If you do not specify any value, it will bring all published entries and published assets.

## setHost

Adds host for the request

```
import Contentstack

final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
stack.setHost("host")                                                                        </span>
```

The host for the API url

## setHeader

adds header using header key and value

```
import Contentstack

final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
stack.setHeader("headerKey", "headerValue")                                                                        </span>
```

The header key

the header value

## removeHeader

Remove header using headerKey

```
import Contentstack

final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
stack.removeHeader("headerKey")                                                                        </span>
```

The header key

## paginationToken

If the result of the initial sync (or subsequent sync) contains more than 100 records, the response would be paginated. It provides pagination token in the response. However, you do not have to use the pagination token manually to get the next batch, the SDK does that automatically until the sync is complete. Pagination token can be used in case you want to fetch only selected batches. It is especially useful if the sync process is interrupted midway (due to network issues, etc.). In such cases, this token can be used to restart the sync process from where it was interrupted.

```
import Contentstack

final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
var response = stack.paginationToken("paginationToken")                                                                        </span>
```

The pagination token

## imageTransform

The Image Delivery API is used to retrieve, manipulate and/or convert image files of your Contentstack account and deliver it to your web or mobile properties.

```
import Contentstack

final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
var image = stack.imageTransform("imageUrl")                                                                         </span>
```

Base Image Url of the image you want to manipulate

## getContentTypes

ContentType accepts contentTypeId in as the parameter

```
import Contentstack

final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
var contentType = stack.getContentTypes()
```

ContentType accepts query params as parameter

## contentType

ContentType accepts contentTypeId in as the parameter

```
import Contentstack

final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
var contentType = stack.contentType("contentTypeId")
```

ContentType accepts contentTypeId as the parameter

## assetQuery

It also returns the content of each asset in JSON format.

```
import Contentstack

final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
var assets = stack.assetQuery()
```

Asset uid

## asset

This call fetches the latest version of a specific. asset of a particular stack.

```
import Contentstack

final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
var asset = stack.asset("uid")
```

Asset uid

## getLivePreview

Live preview of the stack

```
import Contentstack

final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
var preview = stack.getLivePreview
```

## host

host of the stack

```
import Contentstack

final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
var host = stack.host
```

## environment

environment of the stack

```
import Contentstack

final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
var environment = stack.environment
```

## endpoint

endpoint for the api

```
import Contentstack

final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
var endpoint = stack.endpoint
```

## deliveryToken

delivery token for the stack

```
import Contentstack

final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
var deliveryToken = stack.deliveryToken
```

## stack

an instance of the stack

```
import Contentstack

final stack = contentstack.Stack(apiKey, deliveryToken, environment);
```

apiKey of the stack

Delivery Token for the stack

Environment of the stack

apiVersion is version of the API

DB region for your stack. You can choose from six regions namely, NA, EU, Azure NA, Azure EU, GCP NA, and GCP EU.

host of the api

live preview for the stack

Client to make API request

## apiKey

apiKey of for the stack

```
import Contentstack

final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
var apiKey = stack.apiKey
```

## Stack | Dart Delivery SDK | Contentstack

Stack is the central instance in the Dart Delivery SDK that exposes ContentType, asset, assetQuery, and sync operations for fetching content.