api-client-development
Creating API clients with OpenAPI specs, authentication, and OAuth scopes for SCAPI and similar APIs
npx skills add majiayu000/claude-skill-registry --skill api-client-development --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# API Client Development This skill covers creating typed API clients using OpenAPI specifications, with proper authentication and OAuth scope handling. It builds on the patterns in [SDK Module Development](../sdk-module-development/SKILL.md). ## Overview API clients in this project use: - **openapi-fetch**: Type-safe HTTP client generated from OpenAPI specs - **openapi-typescript**: Generates TypeScript types from OpenAPI specs - **Middleware pattern**: Auth and logging injected via openapi-fetch middleware ## Creating a New API Client ### 1. Add the OpenAPI Spec Place the spec in `packages/b2c-tooling-sdk/specs/`: ``` specs/ ├── custom-apis-v1.yaml # YAML or JSON ├── slas-admin-v1.yaml └── ods-api-v1.json ``` ### 2. Update Type Generation Script In `packages/b2c-tooling-sdk/package.json`, add to the generate script: ```json { "scripts": { "generate:types": "openapi-typescript specs/data-api.json -o src/clients/ocapi.generated.ts && openapi-typescript specs/newapi-v1.yaml -o src/clients/newapi.generated.ts" } } ``` Run generation: ```bash pnpm --filter @salesforce/b2c-tooling-sdk run generate:types ``` ### 3. Create the Client Module ```typescript // src/clients/newapi.ts import c
- Overview
- Creating a New API Client
- 1. Add the OpenAPI Spec
- 2. Update Type Generation Script
- 3. Create the Client Module
- 4. Export from Clients Barrel
- SCAPI Client Pattern (OAuth Scope Injection)
- The Problem
- The Solution
- SCAPI Tenant ID Utilities
- Constants
- OAuthStrategy.withAdditionalScopes()
- Complete SCAPI Client Example
- CLI Command Integration
pnpm --filter @salesforce/b2c-tooling-sdk run generate:types
What does the api-client-development skill do?
Creating API clients with OpenAPI specs, authentication, and OAuth scopes for SCAPI and similar APIs
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill api-client-development --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
