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

# Tenants

> Public tenants signatures and configuration in @agentium/core 4.0.0.

Import these **7 exports** from `@agentium/core`. Read the [tenants guide](/advanced/multi-tenant) for setup and behavior, or return to the [package reference](/api-reference/core).

A `?` marks an optional field. These are declarations for lookup; run the examples in the linked guide. Follow related-type links for Agentium types and source links for imported dependency types.

## extractTenantFromHeaders

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/tenant/tenant-context.ts)

```typescript theme={null}
export declare function extractTenantFromHeaders(headers: Record<string, string | string[] | undefined>): string | undefined;
```

## extractTenantFromJwt

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/tenant/tenant-context.ts)

```typescript theme={null}
export declare function extractTenantFromJwt(claims: Record<string, unknown>): string | undefined;
```

## requireTenant

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/tenant/tenant-context.ts)

```typescript theme={null}
export declare function requireTenant(tenantId: string | undefined, config: TenantConfig): string;
```

Related: [`TenantConfig`](/api-reference/core/tenant#tenantconfig).

## TenantConfig

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/tenant/types.ts)

```typescript theme={null}
export interface TenantConfig {
    required: boolean;
    isolation: "namespace" | "strict";
}
```

## TenantContext

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/tenant/types.ts)

```typescript theme={null}
export interface TenantContext {
    tenantId: string;
    metadata?: Record<string, unknown>;
}
```

## TenantScopedStorage

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/tenant/tenant-storage.ts)

```typescript theme={null}
export declare class TenantScopedStorage implements StorageDriver {
    constructor(inner: StorageDriver, tenantId: string);
    initialize(): Promise<void>;
    get<T>(namespace: string, key: string): Promise<T | null>;
    set<T>(namespace: string, key: string, value: T): Promise<void>;
    delete(namespace: string, key: string): Promise<void>;
    list<T>(namespace: string, prefix?: string): Promise<Array<{
        key: string;
        value: T;
    }>>;
    close(): Promise<void>;
    getTenantId(): string;
}
```

Related: [`StorageDriver`](/api-reference/core/storage#storagedriver).

## withTenant

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/tenant/tenant-context.ts)

```typescript theme={null}
export declare function withTenant(tenantId: string, metadata?: Record<string, unknown>): TenantContext;
```

Related: [`TenantContext`](/api-reference/core/tenant#tenantcontext).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.