Igris SDK
The Igris SDK (@igris-security/sdk) is a TypeScript client for the Igris governance gateway. It generates MCP client configurations, calls MCP tools programmatically, and provides a native OpenAI-compatible interface for the LLM gateway.
Installation
Initialize
baseUrl option can also be set via the IGRIS_BASE_URL environment variable.
Get Your API Key
- Log in to the Igris Dashboard
- Go to Settings → API Keys
- Click Generate API Key
- Copy the key — it’s shown only once
MCP Connections
igris.connectHttp(slug, options?)
Generate an HTTP connection config for any external MCP client.
Identity & Metadata
Pass user identity and freeform metadata with every MCP or LLM request. Igris uses this for policy evaluation, audit trails, and trace correlation.How It Works
The SDK translates identity options into HTTP headers:
All fields are optional. If omitted, the gateway still works — just without identity-based policies or user-level audit.
Trace IDs
Trace IDs group multiple tool calls from a single user request:traceId, the SDK generates one automatically (ig_trace_ + random hex). Each connectHttp() call gets its own trace ID.
Metadata for Policies
Metadata enables attribute-based access control:
If a policy condition references a field that is absent from the request, the rule is skipped — not denied.
Metadata limits:
LLM Gateway
igris.chat.completions.create(request)
Send a chat completion through the Igris LLM gateway. The model field must use @slug/model syntax.
Non-streaming:
igris.embeddings.create(request)
igris.llmProviders.list()
Fetch all registered LLM provider slugs and metadata:
igris.connectLlm(slug, options?)
Build an LlmConnection for use with any OpenAI-compatible SDK client:
LLM Types
ChatMessage
ChatCompletionUsage
ChatCompletionResponse
ChatCompletionChunk (streaming)
Subpath Adapters
Zero-migration integration with existing SDK clients. All adapters are exported from@igris-security/sdk/adapters/{openai,anthropic,google}.
OpenAI adapter
Anthropic adapter
Google adapter (stub)
Google’s SDK does not expose a unifiedbaseURL override. The Google adapter returns the LlmConnection config for manual use.
Typed Errors
All SDK methods throw typed errors on non-2xx responses:Environment Variables
Tool Calls
Call MCP tools programmatically with
igris.mcp.Connections
Create and manage encrypted credential vaults.
MCP Client Config
Generate configs for Claude Desktop, Cursor, and more.
API Reference
REST API endpoints for all Igris resources.