@agentskit/integrations — for agents
Unified single-descriptor service-integration catalog projected into tools, connectors, triggers, and OAuth.
#Install
npm install @agentskit/integrations#What it is
One descriptor per service (Integration) that every consumer layer projects from —
agent tools, connector senders, inbound triggers, OAuth specs, marketplace listings.
Eliminates the per-service duplication that otherwise spreads across @agentskit/tools
and host runtimes. Dependency-light: only @agentskit/core, with fetch + node:crypto
at runtime. Ships the canonical descriptor + registry + projection contract, a
bundled ~50-service fetch-only catalog (ADR-0012), auth/actions/triggers, and a
/testing subpath. OSS owns this package; AKOS consumes it (RFC 0003). Stability:
beta — not yet stable.
#Primary exports (main entry)
defineIntegration— author anIntegrationdescriptor (auth,actions,triggers,capabilities).defineAction— define one action; receives an auth-boundIntegrationHttpclient, uses canonical JSON Schema.defineTrigger— define one inbound trigger (verifysignature +normalizeto a uniform event).httpJson— shared HTTP helper (query/body/timeout, non-2xx → typed error; origin-confined whenbaseUrlis set).bindHttp— bind options into a reusableIntegrationHttpclient.HttpToolOptions— shared HTTP options includingsignalfor caller cancellation.createRegistry— build an isolated catalog instance.registerIntegration— register a descriptor into the default catalog.getIntegration— look up a descriptor by service slug.listIntegrations— list all registered descriptors.integrationsByCategory— filter the default catalog by category.toToolDefinitions— project a descriptor's actions into legacyToolDefinition[](auth-bound), preserving thefn(config) => Tool[]API consumers expect.actionToToolDefinition— project a single action into aToolDefinition.httpOptionsFor— build the auth-bound HTTP options for a descriptor + caller config.ProjectionConfig— projection knobs:credential,config,signal,fetch,fetchUntrusted(egress-policy fetch for model-controlled URLs).integrationTools— resolve a catalog integration (by slug or descriptor) and project it toToolDefinition[]in one call.integrationToolsFromEnv— project an integration reading its credential from the environment (via the apiKeyenvHint).credentialEnvVar— the conventional env var holding an integration's API key.CONFIG_FIELDS— declarative connect-form fields (ConfigField[]) for services that authenticate with structured config (Twilio, Jira, Stripe, …) rather than a single API key; attached to each descriptor'sconfigFields.- Named service descriptors — e.g.
slackIntegration,githubIntegration, … (one per catalog entry).
#Execution boundaries (ADR-0026)
- Origin-confined auth-bound HTTP — credentials stay on the configured
baseUrlorigin; automatic redirects are disabled. - Derived confirmation — projection forces confirmation for
write/external/destructiveside effects. fetchUntrusted— required for model-controlled downloads (e.g. Whisper audio URLs). Direct@agentskit/integrationsconsumers must inject an egress-policy fetch; the@agentskit/toolsWhisper facade injectssafeFetchindependently of providerfetch.
#Subpath exports
| Subpath | Contents |
|---|---|
@agentskit/integrations/testing | Pure contract validators: validateIntegration, validateAction, validateTrigger, assertValidIntegration. Gate every service descriptor in CI. |
#Minimal example
import { slackIntegration, toToolDefinitions } from '@agentskit/integrations'
const tools = toToolDefinitions(slackIntegration, {
credential: process.env.SLACK_BOT_TOKEN ?? 'xoxb-your-bot-token',
})#Authoring a descriptor
import { defineIntegration, defineAction } from '@agentskit/integrations'
const ping = defineAction({
name: 'demo_ping',
description: 'Echo a message.',
schema: { type: 'object', properties: { message: { type: 'string' } }, required: ['message'] },
sideEffect: 'read',
execute: (args, http) => http({ method: 'POST', path: '/ping', body: { message: args.message } }),
})
export const demo = defineIntegration({
name: 'demo',
displayName: 'Demo',
categories: ['example'],
http: { baseUrl: 'https://api.example.com' },
auth: { kind: 'apiKey', header: 'authorization', prefix: 'Bearer ' },
actions: [ping],
capabilities: {},
})#Scaffolding
pnpm gen:integration <name> # copies services/_template → services/<name>#Related
- Tools —
@agentskit/tools(legacy integration home; facades project from this package). - ADR-0012 — bundled fetch-only catalog.
- ADR-0026 — execution safety boundaries.
- RFC 0003 — OSS / AKOS product boundary.
Explore nearby
- PeerFor agents — overview
Dense, LLM-friendly reference for every AgentsKit package. Designed to paste into an agent's context window.
- Peer@agentskit/core — for agents
Zero-dependency foundation. Contracts, chat controller, primitives, and a dozen feature subpaths.
- Peer@agentskit/adapters — for agents
Provider adapters (OpenAI-compatible + native) + router + ensemble + fallback + generic factory.