# Install

Canonical URL: https://developers.iagenify.com/sdk/install/
Language: en

One package, iagenify. It ships ESM source for import and a bundled CommonJS build for require, and runs on Node 18 or newer, in the browser and on Cloudflare Workers.

Status: iagenify 0.5.4 · Apache-2.0 · type: module

## Install {#install}

```javascript
npm install iagenify

yarn add iagenify
```

```python
python -m pip install iagenify
```

## Import it {#import}

Both entry points expose the same surface. Which one you get is decided by how you load it.

```javascript
// ESM — resolves to the package source
import { IaGenify } from "iagenify";

// CommonJS — resolves to the bundled build
const { IaGenify } = require("iagenify");
```

## What else is exported {#exports}

The client is the usual entry point, but the error classes, the local primitives and the pure helpers are all reachable, so `instanceof` works and you can use the parsers without the engine.

```javascript
import {
  IaGenify,
  IaGenifyError, Unauthorized, NotEnoughCredits,   // instanceof, not err.name
  LocalFiles, LocalTerminals, Terminal,            // a computer's files and shells
  LocalLibrary, AccountLibrary, AgentLibrary,      // skills and sub-agents
  McpClient, MCP_PROTOCOL_VERSION,
  sanitizeSchema, toolNameFor, createMcpTools,     // pure
  parsePrompt, parseTokenCount, storageSlug, PROMPT_OPTIONS,
  MEDIA_OPTIONS,                                   // what the media tools accept
  AGENT_MODES,                                     // ["ask", "auto", "plan", "full"]
} from "iagenify";
```

## Bundlers {#bundlers}

The SDK imports `node:fs`, `node:os`, `node:path`, `node:crypto` and `node:child_process` dynamically, behind runtime checks, so a browser build never reaches them. Static analysis cannot know that, so the package has to be left alone.

```javascript
// next.config.mjs
const nextConfig = {
  serverExternalPackages: ["iagenify"],
};
export default nextConfig;
```

> **Bundling it breaks the dynamic imports**
>
> And it breaks them at runtime, as a missing module, not at build time. If a server-side call suddenly cannot find node:fs, this is why.

## Environment {#env}

Two variables are read. Neither is required if you pass the values yourself.

| Variable | Effect |
| --- | --- |
| IAGENIFY_API_KEY | Conventional, not read by the SDK. Pass it as apiKey. |
| IAGENIFY_API_URL | The baseUrl, when you do not pass one: https://api.iagenify.com. |

```bash
# .env
IAGENIFY_API_KEY=ia_your_key_here
IAGENIFY_API_URL=https://api.iagenify.com
```

## What it needs {#requirements}

|  | Requirement |
| --- | --- |
| Node | 18 or newer. fetch, FormData, Blob and AbortController are used unpolyfilled. |
| Browser | Any modern browser. The session lives in localStorage. |
| Workers | Cloudflare Workers. The session lives in memory for the life of the isolate. |
| Dependencies | None. The package pulls nothing into your tree at runtime. |

## Check it works {#verify}

```javascript
import { IaGenify } from "iagenify";

const api = new IaGenify({ apiKey: process.env.IAGENIFY_API_KEY });

console.log(api.env);            // "node"
console.log(api.capabilities);   // { runtime, shell, filesystem, persistentStorage, http }
console.log(await api.getUser());
console.log((await api.catalogue()).length, "models");
```

```python
# Python has a single import form: the package is installed with pip
# (python -m pip install iagenify) and imported directly.
from iagenify import IaGenify
```

```python
from iagenify import (
    IaGenify,
    IaGenifyError, Unauthorized, NotEnoughCredits,   # isinstance(), not error.name
    LocalFiles, LocalTerminals, Terminal,            # a computer's files and shells
    LocalLibrary, AccountLibrary, AgentLibrary,      # skills and sub-agents
    McpClient, MCP_PROTOCOL_VERSION,
    sanitize_schema, tool_name_for, create_mcp_tools,  # pure
    parse_prompt, parse_token_count, storage_slug, PROMPT_OPTIONS,
    MEDIA_OPTIONS,                                   # what the media tools accept
    AGENT_MODES,                                     # ("ask", "auto", "plan", "full")
)
```

```python
# A Python web framework needs no bundler setting: Django, Flask or FastAPI
# import the package like any other dependency.
# pyproject.toml
# dependencies = ["iagenify>=0.1.0"]
```

```python
import os
from iagenify import IaGenify

api = IaGenify(api_key=os.environ["IAGENIFY_API_KEY"])

print(api.env)            # "python"
print(api.capabilities)   # {"runtime", "shell", "filesystem", "persistentStorage", "http"}
print(api.get_user())
print(len(api.catalogue()), "models")
```
