---
title: "Config"
description: "Config"
url: "https://www.contentstack.com/docs/developers/sdks/content-delivery-sdk/android/reference/config"
product: "Contentstack"
doc_type: "guide"
audience:
  - developers
  - admins
version: "current"
last_updated: "2026-09-23"
---

# Config

## Config

Config class that exposes config instance, Where the user can provide other configurations on the stack

## setBranch

The setBranch method sets the target branch for the stack to retrieve content from a specific development or release branch.

```
import com.contentstack.sdk.*;

Config config = new Config();
config.setBranch("branchName");
Stack stack = Contentstack.stack(context, "apiKey", "deliveryToken", "environment", config);
```

branch you want to set

## getBranch

The getBranch method retrieves the branch currently set on the stack.

```
import com.contentstack.sdk.*;

Config config = new Config();
config.getBranch();
Stack stack = Contentstack.stack(context, "apiKey", "deliveryToken", "environment", config);
```

## setProxy

The setProxy method sets a custom proxy to route SDK network requests through a specified HTTP proxy server.

```
import com.contentstack.sdk.*;

java.net.Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("proxyHost", "proxyPort"));
java.net.Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("sl.theproxyvpn.io", 80));
Config config = new Config();
config.setProxy(proxy);
```

Proxy setting, typically a type (http, socks) and a socket address. A Proxy is an immutable object

## getProxy

The getProxy method retrieves the current proxy instance configured for routing network requests.

```
import com.contentstack.sdk.*;

Config config = new Config();
config.getProxy();
Stack stack = Contentstack.stack(<span>context,</span>"apiKey", "deliveryToken", "environment", config);
```

## getRegion

The getRegion method retrieves the region associated with the request URL.

```
import com.contentstack.sdk.*;

Config config = new Config();
config.getRegion();
Stack stack = Contentstack.stack(<span>context,</span>"apiKey", "deliveryToken", "environment", config);
```

## setRegion()

The setRegion method sets the database region for your stack. You can choose from seven regions: NA, AU, EU, Azure NA, Azure EU, GCP NA, and GCP EU.

```
import com.contentstack.sdk.*;
Config config = new Config();
config.setRegion(ContentstackRegion.EU);
Stack stack = Contentstack.stack("apiKey", "deliveryToken", "environment", config);
```

You can choose from seven regions namely, NA, EU, AU, Azure NA, Azure EU, GCP NA, and GCP EU.

## getHost()

The getHost method retrieves the host associated with the request URL.

```
import com.contentstack.sdk.*;

Config config = new Config();
config.getHost();
Stack stack = Contentstack.stack(<span>context,</span>"apiKey", "deliveryToken", "environment", config);
```

## setHost()

The setHost method sets a custom host for the request URL to direct API calls to a specified endpoint.

```
import com.contentstack.sdk.*;

Config config = new Config();
config.sethost(hostname);
Stack stack = Contentstack.stack(<span>context,</span>"apiKey", "deliveryToken", "environment", config);
```

The host

## getVersion()

The getVersion method retrieves the version of the request path.

```
import com.contentstack.sdk.*;

Config config = new Config();
config.getVersion();
Stack stack = Contentstack.stack(<span>context,</span>"apiKey", "deliveryToken", "environment", config);
```

## enableLivePreview()

Enables Live Preview

```
import com.contentstack.sdk.*;

Config config = new Config()
config.enableLivePreview(true)
Stack stack = Contentstack.stack(context,"apiKey", "deliveryToken", "environment", config);
```

Provide true to enable the Live Preview

## setLivePreviewHost()

Sets Host to the Live Preview request url

```
import com.contentstack.sdk.*;

Config config = new Config()
config.setLivePreviewHost(host)
Stack stack = Contentstack.stack(context,"apiKey", "deliveryToken", "environment", config);
```

Host for Live Preview

## setManagementToken()

The setManagementToken method adds the management token to the stack header to authorize content management operations.

```
import com.contentstack.sdk.*;

Config config = new Config();
config.setManagementToken(managementToken);
Stack stack = Contentstack.stack(<span>context,</span>"apiKey", "deliveryToken", "environment", config);
```

The Management Token

## earlyAccess

The earlyAccess method retrieves features by enabling the early access header, allowing access to functionalities that are part of the early access program.

```
Example:

Config config = new Config();
String[] earlyAccess = {"Taxonomy", "Teams", "Terms", "LivePreview"};
config.earlyAccess(earlyAccess);
stack = Contentstack.stack("apiKey", "deliveryToken", "environment", config);
```

## Config | Android Delivery SDK | Contentstack

Config exposes a configuration instance in the Android Delivery SDK, letting you set additional options on the Contentstack stack.