/ama-sdk:sdk-pluginsfrom ama-sdk
Configure built-in @ama-sdk plugins and create custom ones for request transformation, authentication, resilience (retry/timeout), and response processing.
Ships in ama-sdk. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Configure built-in plugins and create custom ones for @ama-sdk clients.
Plugins are registered on client instantiation and execute in order:
const client = new ApiFetchClient({
basePath: 'https://api.example.com',
requestPlugins: [/* transform request before sending */],
fetchPlugins: [/* wrap the fetch call itself */],
replyPlugins: [/* process the response */]
});
Execution order:
requestPlugins transform the RequestOptions (headers, query params, body)fetchPlugins wrap the actual HTTP call (retry, timeout, abort)replyPlugins process the response (deserialization, error handling)Important: When customizing
replyPlugins, always re-apply theExceptionReplyandReviverReplyplugins. These are included by default but will be lost if you override the array. Without them, the SDK cannot deserialize responses or throw typed exceptions properly.
For the full up-to-date list of available plugins, browse the source directories:
@ama-sdk/core): https://github.com/AmadeusITGroup/otter/tree/main/packages/@ama-sdk/core/src/plugins@ama-sdk/client-fetch): https://github.com/AmadeusITGroup/otter/tree/main/packages/@ama-sdk/client-fetch/src/pluginsimport { ApiKeyRequest } from '@ama-sdk/core';
import { ApiFetchClient } from '@ama-sdk/client-fetch';
const client = new ApiFetchClient({
basePath: 'https://api.example.com',
requestPlugins: [
new ApiKeyRequest('Bearer my-token', 'Authorization')
]
});
import { ApiKeyRequest } from '@ama-sdk/core';
const client = new ApiFetchClient({
basePath: 'https://api.example.com',
requestPlugins: [
new ApiKeyRequest(async () => {
const token = await refreshToken();
return `Bearer ${token}`;
}, 'Authorization')
]
});
import { TimeoutFetch, RetryFetch } from '@ama-sdk/client-fetch';
const client = new ApiFetchClient({
basePath: 'https://api.example.com',
fetchPlugins: [
new TimeoutFetch(15_000),
new RetryFetch(
3,
(_context, data, error) => !!error || data?.status >= 500,
(attempt) => attempt * 1000
)
]
});
import { ApiKeyRequest, SessionIdRequest } from '@ama-sdk/core';
import { ApiFetchClient, TimeoutFetch, RetryFetch } from '@ama-sdk/client-fetch';
const client = new ApiFetchClient({
basePath: 'https://api.example.com',
requestPlugins: [
new ApiKeyRequest(process.env.API_KEY, 'X-API-Key'),
new SessionIdRequest()
],
fetchPlugins: [
new TimeoutFetch(30_000),
new RetryFetch(2, (_ctx, resp) => resp?.status >= 500, () => 2000)
]
});
A request plugin transforms RequestOptions before the HTTP call:
import { PluginRunner, RequestOptions, RequestPlugin } from '@ama-sdk/core';
export class CorrelationIdRequest implements RequestPlugin {
public load(): PluginRunner<RequestOptions, RequestOptions> {
return {
transform: async (data: RequestOptions) => {
data.headers.append('X-Correlation-ID', crypto.randomUUID());
return data;
}
};
}
}
Register it:
const client = new ApiFetchClient({
basePath: 'https://api.example.com',
requestPlugins: [new CorrelationIdRequest()]
});
A fetch plugin wraps the HTTP call itself (for cross-cutting concerns like logging, metrics, circuit-breaking):
import { PluginAsyncRunner } from '@ama-sdk/core';
import { FetchCall, FetchPlugin, FetchPluginContext, PluginAsyncStarter } from '@ama-sdk/client-fetch';
export class LoggingFetch implements FetchPlugin {
public load(context: FetchPluginContext): PluginAsyncRunner<Response, FetchCall> & PluginAsyncStarter {
return {
transform: async (fetchCall: FetchCall) => {
const start = performance.now();
const response = await fetchCall();
const duration = performance.now() - start;
console.log(`[${context.url}] ${response.status} in ${duration.toFixed(0)}ms`);
return response;
}
};
}
}
Register it:
const client = new ApiFetchClient({
basePath: 'https://api.example.com',
fetchPlugins: [new LoggingFetch(), new TimeoutFetch(30_000)]
});
Plugins execute in array order:
Place auth plugins first (so all requests are authenticated), then resilience plugins.
Read the authoritative interface definitions directly from source:
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
sdk-plugins, request-plugins, fetch-plugins, reply-plugins, api-client
npx claudepluginhub amadeusitgroup/otter --plugin ama-sdk4 skills in this plugin
/create-sdkCreate a new TypeScript SDK from an OpenAPI specification, either as a standalone project or inside an existing Angular/Nx monorepo. Use when user wants to scaffold, bootstrap, initialize, or generate an SDK./sdk-mcp-setupInstall and configure the @ama-sdk/mcp server so AI assistants can read SDK_CONTEXT.md from installed SDK packages. Use when the get_sdk_context tool is unavailable, or the user asks to "set up the ama-sdk mcp" or "configure sdk context server"./use-sdkInstall, configure, and use a TypeScript SDK generated with @ama-sdk. Use when user wants to call APIs, set up a client (fetch, Angular, beacon), or understand how to use an existing SDK package.Other plugins' skills for the same job