> ## Documentation Index
> Fetch the complete documentation index at: https://docs.truststack.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Admin

The `admin` module is used to manage `organizations` and in the future, other administrative resources for your tenant.

# Installation

With `@truststack/sdk` installed and configured, or alternatively, just the `@truststack/admin` package.

<CodeGroup>
  ```bash npm theme={null}
  npm install @truststack/sdk
  # or
  npm install @truststack/admin
  ```

  ```bash yarn theme={null}
  yarn add @truststack/sdk
  # or
  yarn add @truststack/admin
  ```

  ```bash pnpm theme={null}
  pnpm add @truststack/sdk
  # or
  pnpm add @truststack/admin
  ```
</CodeGroup>

# Managing Organizations

Using the `Admin` module, you can manage organizations. An `organization` is just a logic grouping of users that likely exists on your platform.

Read more about [organizations](/documentation/organizations) to learn more.

## Create an Organization

To create an organization, you can use the `Admin` module.

<CodeGroup>
  ```typescript Admin Package theme={null}
  import { AdminClient } from '@truststack/admin';

  const client = new AdminClient();
  const organization = await client.createOrganization({ name: 'ACME Farms' });

  console.log(organization);

  ```

  ```typescript SDK theme={null}
  import { TrustStack } from '@truststack/sdk';

  const client = new TrustStack();
  const organization = await client.admin.createOrganization({ name: 'ACME Farms' });

  console.log(organization);

  ```
</CodeGroup>

```json Response theme={null}
{
  "id": "'ACME-FARMS-ID",
  "name": "ACME Farms",
  "createdAt": "2024-03-20T10:30:00Z",
  "updatedAt": "2024-03-20T10:30:00Z"
}
```

## Update an Organization

To update an organization, you can use the `updateOrganization` method.

```typescript theme={null}
const organization = await client.updateOrganization({
  id: "ACME-FARMS-ID",
  name: "Clean and Green ACME Farms",
});

console.log(organization);
```

```json Response theme={null}
{
  "id": "ACME-FARMS-ID",
  "name": "Clean and Green ACME Farms",
  "createdAt": "2024-03-20T10:30:00Z",
  "updatedAt": "2024-03-20T10:30:00Z"
}
```

## Delete an Organization

To delete an organization, you can use the `deleteOrganization` method.

```typescript theme={null}
await client.deleteOrganization("ACME-FARMS-ID");
```

## Get an Organization

To get an organization, you can use the `getOrganization` method.

```typescript theme={null}
const organization = await client.getOrganization("ACME-FARMS-ID");
console.log(organization);
```
