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

# Contentstack

## Contentstack

Creates an instance of \`Contentstack\`.

## Stack

```
Initialize Stack:
import Contentstack from 'contentstack';
const Stack = Contentstack.Stack({ api_key: 'api_key', delivery_token: 'delivery_token', environment: 'environment' });
To set the European, Azure North American, Azure European, or GCP North America region, refer to the code below:
import Contentstack from 'contentstack';
const Stack = new Contentstack({ 'api_key': "api_key", 'delivery_token': "delivery_token", 'environment': "environment", "region": Contentstack.Region.<<add_your_region>>})
For Setting the Branch for a Region.
import Contentstack from 'contentstack';
const Stack = Contentstack.Stack({ api_key: 'api_key', delivery_token: 'delivery_token', environment: 'environment', region: Contentstack.Region.<<add_your_region>>, host: '<<add_your_host_URL>>', branch: 'branch')


Proxy Configuration
const Stack = Contentstack.Stack({ 
    api_key: 'api_key', 
    delivery_token: 'delivery_token', 
    environment: 'environment',
    URL: URL,
    fetchOptions: {
       fetch: `proxy-url`
    }
});
Here are a few examples of how you can add a username and password to HttpProxyAgent.


  You can pass it in the URI:
var proxyAgent = new HttpsProxyAgent('https://username:password@your-proxy.com');

  You can set it in the auth option
var proxyOpts = url.parse('https://your-proxy.com');
proxyOpts.auth = 'username:password';
var proxyAgent = new HttpsProxyAgent(proxyOpts);

  You can even set the HTTP header manually:
var proxyOpts = url.parse('https://your-proxy.com');
proxyOpts.headers = {
  'Proxy-Authentication': 'Basic ' + new Buffer('username:password').toString('base64')
};
var proxyAgent = new HttpsProxyAgent(proxyOpts);
```

Stack API key

Stack Delivery token.

Stack Environment name.

DB region for Stack. You can choose from five regions namely, NA, EU, Azure NA, Azure EU, and GCP NA.

Name of the branch you want to fetch data from

Live preview configuration.

Optional, to enable debug logs set to true.

A log handler function to process given log messages & errors.

Set timeout for the request.

The number of retries before failure.

The number of ms to use for operation retries.

A function to determine if the error can be retried.

The base number of milliseconds to use in the exponential backoff for operation retries.

A custom function that accepts a retry count and error and returns the amount of time to delay in milliseconds.

## Plugins

```
When creating custom plugins, through this request, you can pass the detailss of your custom plugins. This facilitates their utilization in subsequent requests when retrieving details.
// custom class for plugin
class CrossStackPlugin {
  onRequest (stack, request) {
    // request modifications
    return request
  }
  async onResponse (stack, request, response, data) {
    // response modifications here
    return response
  }
}

const Stack = Contentstack.Stack({
  api_key,
  delivery_token,
  environment,
  plugins: [
    new CrossStackPlugin(),
    new Livepreview()
  ]
});
```

## Contentstack

CachePolicy contains different cache policies constants.

CachePolicy contains different cache policies constants.

## Contentstack | React Native Delivery SDK | Contentstack

The Contentstack class in the React Native Delivery SDK creates a Contentstack instance, the entry point for initializing and accessing a stack.