api-client-development

Generate typed TypeScript API clients from OpenAPI specifications with OAuth scope handling.

51|16|Updated Oct 31, 2025
One-click install
npx skills add https://github.com/SalesforceCommerceCloud/b2c-developer-tooling --skill api-client-development
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-client-development
Source: https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/tree/main/.claude/skills/api-client-development
Command: npx skills add https://github.com/SalesforceCommerceCloud/b2c-developer-tooling --skill api-client-development

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill enables building typed API clients from OpenAPI specifications with proper authentication and OAuth scope handling, reducing boilerplate and ensuring consistent client modules across CLIs and SDKs.

Core Features & Use Cases

  • OpenAPI-based code generation: generate TypeScript clients using openapi-fetch and openapi-typescript.
  • Middleware integration: attach authentication and logging via reusable middleware.
  • OAuth scope encapsulation: encapsulate tenant-scoped OAuth logic within the client factory for SCAPI-like APIs.
  • Use Case: rapidly add a new API client for a DX/SCAPI service and re-use it in CLI commands or SDKs.

Quick Start

Add your OpenAPI spec to specs/, update the client generation script, and create a module that exports a typed client factory ready for integration into your CLI or SDK.

Frequently Asked Questions about api-client-development

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate a TypeScript API client from an OpenAPI spec?

To generate a TypeScript API client from an OpenAPI spec, add your specification file to the specs directory and run the client generation script to produce typed code using openapi-fetch and openapi-typescript.

How does OAuth scope handling work for SCAPI typed clients?

OAuth scope handling for SCAPI typed clients works by encapsulating tenant-scoped OAuth logic directly within the client factory, ensuring authentication credentials are properly injected when initializing the module.

What is the best way to add reusable middleware to a generated API client?

The best way to add reusable middleware to a generated API client is by attaching authentication and logging components through the middleware integration layer during client factory initialization.

Can I use a generated OpenAPI client in both CLI and SDK development?

Yes, you can use a generated OpenAPI client in both CLI and SDK development by exporting the typed client factory from your module, allowing rapid integration into CLI commands or SDK packages.

Do I need openapi-typescript to build typed clients for SCAPI services?

Yes, you need openapi-typescript alongside openapi-fetch to build typed clients for SCAPI services, as they provide the foundational type generation and fetch capabilities required for the client module.