# Utilities

## `getIntelligemsConfig()`

Fetches the Intelligems headless configuration for an organization.

```ts
import { getIntelligemsConfig } from "@intelligems/headless";

const config = await getIntelligemsConfig("org_id", 5);
```

```ts
import type { PluginConfigType } from "@intelligems/ig-types";

const getIntelligemsConfig: (
  organizationId: string,
  cacheIntervalMinutes?: number
) => Promise<PluginConfigType | undefined>;
```

## `setLogLevel()`

Sets the internal logger level. Allowed values are `"DEBUG"`, `"INFO"`, `"WARNING"`, and `"ERROR"`.

```ts
import { setLogLevel } from "@intelligems/headless";

setLogLevel("INFO");
```

```ts
const setLogLevel: (level: "DEBUG" | "INFO" | "WARNING" | "ERROR") => void;
```

## `IntelligemsContext`

React context that exposes the Intelligems client state.

```tsx
import { IntelligemsContext } from "@intelligems/headless";

const { data } = useContext(IntelligemsContext);
```
