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

# ContentstackClient

## ContentstackClient

## login

The login call is used to sign in to your Contentstack account and obtain the authtoken.

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

client.login({ email: <emailid>, password: <password> })
.then(() => {

}))
```

email id for user to login

password for user to login

token for user to login

## getUser

The getUser call returns comprehensive information of an existing user account. The information returned includes details of the stacks owned by and shared with the specified user account.

```
import * as contentstack from '@contentstack/management'

const client = contentstack.client()
client.getUser()
.then((user) => {

})
```

## logout

The logOut of your account call is used to sign out the user of Contentstack account.

```
import * as contentstack from '@contentstack/management'

const client = contentstack.client()
client.logout()
.then((response) => {

})

import * as contentstack from '@contentstack/management'
const client = contentstack.client()

client.logout('AUTHTOKEN')
.then((response) => {

})
```

Authtoken to logout from.

## stack

Get Stack instance. A stack is a space that stores the content of a project.

```
import * as contentstack from '@contentstack/management'

const client = contentstack.client()
const stack = {name: 'My New Stack'}

client.stack().create({ stack }, { organization_uid: 'org_uid' })
.then((stack) =>{

})

import * as contentstack from '@contentstack/management'
const client = contentstack.client()
client.stack({ api_key: 'api_key'}).fetch()
.then((stack) => {

})
import * as contentstack from '@contentstack/management'

const client = contentstack.client()
client.stack({ api_key: 'api_key', management_token: 'management_token'
})
.contentType('content_type_uid')
.fetch()
.then((stack) => console.log(stack))
import * as contentstack from '@contentstack/management'

const client = contentstack.client()
client.stack({ api_key: 'api_key', management_token: 'management_token', branch_uid: 'branch_uid' })
.contentType('content_type_uid').fetch()
.then((stack) => {

})
```

Stack API Key

Management token for Stack.

Branch name or alias to access specific branch.

## organization

Organization is the top-level entity in the hierarchy of Contentstack, consisting of stacks and stack resources, and users.

```
import * as contentstack from '@contentstack/management'

const client = contentstack.client()
client.organization().findAll()
.then((organization) => {

})

import * as contentstack from '@contentstack/management'
const client = contentstack.client()

client.organization('org_uid').fetch()
.then((organization) => {

})
```

Organization UID.