Getting started

Install

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.

iagenify 0.5.4Apache-2.0type: module
Using Python?

Switch any code block to Python: the choice applies to every page. Python SDK guide and resource reference.

Install

npm install iagenify

yarn add iagenify
python -m pip install iagenify

Import it

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

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

// CommonJS — resolves to the bundled build
const { IaGenify } = require("iagenify");
# Python has a single import form: the package is installed with pip
# (python -m pip install iagenify) and imported directly.
from iagenify import IaGenify

What else is exported

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.

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";
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")
)

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.

// next.config.mjs
const nextConfig = {
  serverExternalPackages: ["iagenify"],
};
export default nextConfig;
# 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"]
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

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

VariableEffect
IAGENIFY_API_KEYConventional, not read by the SDK. Pass it as apiKey.
IAGENIFY_API_URLThe baseUrl, when you do not pass one: https://api.iagenify.com.
# .env
IAGENIFY_API_KEY=ia_your_key_here
IAGENIFY_API_URL=https://api.iagenify.com

What it needs

Requirement
Node18 or newer. fetch, FormData, Blob and AbortController are used unpolyfilled.
BrowserAny modern browser. The session lives in localStorage.
WorkersCloudflare Workers. The session lives in memory for the life of the isolate.
DependenciesNone. The package pulls nothing into your tree at runtime.

Check it works

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");
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")