/ama-sdk:use-sdkfrom ama-sdk
Installs, configures, and uses TypeScript SDKs generated with @ama-sdk. Helps set up API clients (fetch, Angular, beacon) and make API calls.
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.
Install a TypeScript SDK, generated with @ama-sdk/schematics, configure an API client, and make API calls.
| Client | Package | Best For |
|---|---|---|
| ApiFetchClient | @ama-sdk/client-fetch | Node.js, browsers, standalone apps, SSR, Angular apps with ApiManager |
| ApiAngularClient | @ama-sdk/client-angular | Angular apps needing HttpClient (interceptors, SSR transfer state) |
| ApiBeaconClient | @ama-sdk/client-beacon | Fire-and-forget tracking/analytics calls |
In Angular apps, prefer ApiFetchClient with ApiManager (see below) unless you specifically need Angular's HttpClient features (interceptors, transfer state).
# @my-org/my-sdk is a placeholder for the generated SDK package name
npm install @ama-sdk/client-fetch @ama-sdk/core @my-org/my-sdk
import { ApiFetchClient } from '@ama-sdk/client-fetch';
import { PetApi } from '@my-org/my-sdk';
const client = new ApiFetchClient({
basePath: 'https://api.example.com/v1',
requestPlugins: [],
fetchPlugins: []
});
const petApi = new PetApi(client);
For the full list of options, read the source interfaces:
BaseApiFetchClientOptions and BaseApiFetchClientConstructor)BaseApiClientOptions)ng add @ama-sdk/client-angular
npm install @my-org/my-sdk
import { inject } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { ApiAngularClient } from '@ama-sdk/client-angular';
const client = new ApiAngularClient({
httpClient: inject(HttpClient),
basePath: 'https://api.example.com/v1'
});
In practice, don't instantiate clients manually in services — use ApiManager (see below) to centralize configuration.
BaseApiAngularClientOptions)In Angular applications, use @o3r/apis-manager to centralize client configuration across all your APIs instead of manually instantiating each API class. Works with any client (ApiFetchClient or ApiAngularClient). The ApiManager holds a default client configuration (applied to all APIs) and optional per-API overrides.
ng add @o3r/apis-manager
import { ApplicationConfig } from '@angular/core';
import { ApiKeyRequest } from '@ama-sdk/core';
import { ApiFetchClient } from '@ama-sdk/client-fetch';
import { ApiManager, provideApiManager } from '@o3r/apis-manager';
const apiManager = new ApiManager(
// Default configuration for all APIs
new ApiFetchClient({
basePath: 'https://api.example.com',
requestPlugins: [new ApiKeyRequest('Bearer my-token', 'Authorization')]
}),
// Per-API overrides (replaces default plugins entirely for that API)
{
StoreApi: new ApiFetchClient({
basePath: 'https://api.example.com',
requestPlugins: [new ApiKeyRequest('store-secret', 'X-Store-Key')],
fetchPlugins: [new TimeoutFetch(60_000)]
})
}
);
export const appConfig: ApplicationConfig = {
providers: [
provideApiManager(apiManager)
]
};
Inject ApiFactoryService to get API instances pre-configured with their plugins:
import { ApiFactoryService } from '@o3r/apis-manager';
import { PetApi } from '@my-org/my-sdk';
@Injectable()
class PetService {
private readonly petApi = inject(ApiFactoryService).getApi(PetApi);
}
import { ApiManager, ApiFactoryService } from '@o3r/apis-manager';
import { ApiFetchClient } from '@ama-sdk/client-fetch';
import { ExampleApi } from '@my-org/my-sdk';
@Injectable()
class MyService {
private readonly apiManager = inject(ApiManager);
private readonly apiFactoryService = inject(ApiFactoryService);
updateConfig() {
this.apiManager.setConfiguration(new ApiFetchClient({...}), ExampleApi.apiName);
const api = this.apiFactoryService.getApi(ExampleApi, true); // true = refresh cache
}
}
INITIAL_APIS_TOKEN to swap SDK implementations at app level without changing library code.npm install @ama-sdk/client-beacon @my-org/my-sdk
import { ApiBeaconClient } from '@ama-sdk/client-beacon';
import { TrackingApi } from '@my-org/my-sdk';
const client = new ApiBeaconClient({
basePath: 'https://tracking.example.com'
});
const trackingApi = new TrackingApi(client);
Use for fire-and-forget requests (e.g., analytics, page views). Beacon requests survive page navigation.
For the full list of Beacon client options, read the source:
BaseApiBeaconClientOptions)All generated API classes follow the same pattern:
// Simple GET
const pets = await petApi.listPets();
// GET with parameters
const pet = await petApi.getPetById({ petId: '123' });
// POST with body
const newPet = await petApi.createPet({
CreatePetRequest: { name: 'Fido', species: 'dog' }
});
// With request options override
const result = await petApi.listPets({}, {
headers: new Headers({ 'X-Custom': 'value' })
});
Generated SDKs use a three-level model hierarchy:
src/models/base/) — Direct TypeScript interfaces from the spec. Regenerated on every typescript-core run. Do not edit.src/models/core/) — Extended models with runtime features (revivers, factories). Safe to customize.Revivers transform raw JSON responses into typed model instances:
import { revivePet } from '@my-org/my-sdk';
// Automatic: ReplyPlugin 'reviver' handles this by default
// Manual usage:
const rawJson = await fetch('/pets/1').then(r => r.json());
const typedPet = revivePet(rawJson);
The default replyPlugins include a ReviverReply that automatically applies revivers to API responses.
The default replyPlugins include an ExceptionReply that throws typed errors:
try {
const pet = await petApi.getPetById({ petId: 'invalid' });
} catch (error) {
// error contains status, headers, and parsed body
console.error(error.status); // e.g., 404
}
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
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"./sdk-pluginsUse and create @ama-sdk plugins for request transformation, authentication, resilience, and response processing. Use when user asks about SDK plugins, wants to add auth/retry/timeout, needs to create a custom plugin, or wants to transform requests before sending, wrap the fetch call itself (logging, metrics, circuit-breaking), or process/transform responses.Other plugins' skills for the same job