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

# SDKs & Client Libraries

> Auto-generated Python and TypeScript SDKs for CRAFT APIs

# SDKs & Client Libraries

CRAFT provides auto-generated SDKs for **Python** and **TypeScript**, built from OpenAPI specifications on every release.

> [card] [Python SDK](https://docs.emergence.ai/sdks/python.md)
>
> Type-safe Python client with async support, Pydantic models, and full API coverage.

> [card] [TypeScript SDK](https://docs.emergence.ai/sdks/typescript.md)
>
> Fully typed TypeScript client for Node.js and browser environments.

## Available SDKs

| Package | Python (PyPI) | TypeScript (npm) | API |
| - | - | - | - |
| **Governance** | `em-runtime-governance-sdk` | `@emergence-ai/em-runtime-governance-sdk` | Organizations, Projects, Permissions |
| **Assets** | `em-runtime-assets-sdk` | `@emergence-ai/em-runtime-assets-sdk` | Data Connections, Artifacts, Files, Models |
| **Utils** | `em-runtime-utils-sdk` | `@emergence-ai/em-runtime-utils-sdk` | Data Catalog, Scheduling, Context Packs, Memories |

## SDK Generation Pipeline

SDKs are auto-generated from OpenAPI specs using [openapi-python-client](https://github.com/openapi-generators/openapi-python-client) and the OpenAPI Generator for TypeScript. The pipeline runs on every final release:

**1. Extract OpenAPI specs**

FastAPI apps export their schemas via `app.openapi()` at build time.

**2. Generate client code**

OpenAPI specs are fed to code generators producing typed clients with models, API classes, and authentication helpers.

**3. Publish packages**

Python SDKs publish to Google Artifact Registry. TypeScript SDKs publish to the `@emergence-ai` npm scope.

**4. Version sync**

SDK versions match the platform release version (e.g., platform v5.28.0 → SDK v5.28.0).

> [!NOTE]
>
> SDK versions may lag behind the latest platform service versions. For example, the Runtime UI may use Assets SDK v5.27.0 while the Assets service is at v5.28.0. SDKs are backward-compatible, newer service versions serve older SDK clients without issue. Check the release notes for current versions.

## Authentication

All SDKs use JWT bearer token authentication via Keycloak:

```python theme={null}
from em_runtime_governance_sdk import AuthenticatedClient

client = AuthenticatedClient(
    base_url="https://your-instance.emergence.ai",
    token="your-jwt-token"
)
```

```typescript theme={null}
import { Configuration, OrganizationsApi } from '@emergence-ai/em-runtime-governance-sdk';

const config = new Configuration({
  basePath: 'https://your-instance.emergence.ai',
  accessToken: 'your-jwt-token',
});

const api = new OrganizationsApi(config);
```

## Registry Configuration

SDKs are hosted on Google Artifact Registry (private). Configure your package manager:

> [tab] Python (pip/uv)
>
> ```bash theme={null}
> # Add the Artifact Registry index
> uv add em-runtime-governance-sdk --index-url https://us-central1-python.pkg.dev/aip-artifacts-store/aipy/simple/
>
> # Or with pip
> pip install em-runtime-governance-sdk \
>   --index-url https://us-central1-python.pkg.dev/aip-artifacts-store/aipy/simple/
> ```

> [tab] TypeScript (npm)
>
> ```bash theme={null}
> # Configure the @emergence-ai scope
> echo "@emergence-ai:registry=https://us-central1-npm.pkg.dev/aip-artifacts-store/aip-npm/" >> .npmrc
>
> # Install
> npm install @emergence-ai/em-runtime-governance-sdk
> ```

> [!NOTE]
>
> Registry authentication requires Google Cloud credentials. See your platform admin for access tokens or Workload Identity setup.

## Next Steps

> [card] [Python SDK Guide](https://docs.emergence.ai/sdks/python.md)
>
> Installation, usage patterns, error handling

> [card] [TypeScript SDK Guide](https://docs.emergence.ai/sdks/typescript.md)
>
> Setup, type safety, async patterns

> [card] [API Reference](https://docs.emergence.ai/api-reference/introduction.md)
>
> Interactive API playground with all endpoints

> [card] [Authentication](https://docs.emergence.ai/platform/authentication.md)
>
> Keycloak OIDC setup and token management


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