SDK Design
SDK design is the practice of building client libraries that let developers call an API comfortably in their own language. It covers client shape, naming, sync and async methods, error handling, authentication, versioning, and the tests and docs that ship with the package, so the SDK feels like a native library rather than a thin HTTP wrapper.
itSoftware engineering | OpenSkills.info
Course pathWalk it in order
Look it upDip in anytime
Go furtherLeaves this page
Don't Panic
Don't Panic — SDK Design
An SDK is the bit of software that lets an application speak to an API without requiring every developer to become a part-time HTTP archaeologist. The API says which operations exist. The SDK turns those operations into a client, methods, types, credentials, retries, and errors that make sense in a particular language. The job is not to hide the service behind a fog machine. It is to make the service recognizable and pleasant to use.
Start with the API contract, because it is the closest thing this story has to a load-bearing wall. Resources, operations, inputs, outputs, and failures already exist there. A good client groups them into a service-shaped object and gives them names that fit the target language. If the service has customers, the SDK should not suddenly present an interpretive dance of generic request helpers. It should offer customer operations with typed results.
The two ideas worth keeping are client construction and method shape. Construct the client once with its endpoint, credential, and options; then reuse it. Turn ordinary operations into clear methods. For a list, return an iterator or stream so the page token stays in the SDK, where it can quietly do its administrative paperwork. For work that takes time, return a handle that can be polled or awaited instead of leaving a caller staring at one increasingly suspicious connection.
The surprise is that failure behavior is part of the product. A generic exception is technically an error model in the same way that a cardboard box is technically a filing system. Consumers need to tell invalid input from expired credentials, service responses from transport failures, and retryable trouble from trouble that needs a human decision. Sync and async paths need the same honesty, including paging and cancellation.
Then comes versioning, which is where a library discovers it has made promises. The package follows semantic versioning while the API version remains pinned per SDK release. A renamed method, changed type, or different error contract is a breaking public change, even when the request still reaches the server. Deprecation gives consumers a bridge; a surprise removal gives them a Tuesday.
Read the Intro for the whole client-to-service map. Use the Slides when you want the flow and design choices in one view. Keep the Cheatsheet beside a review, especially for error categories and release rules. The practice reference and exercise turn one small API operation into a public SDK surface, which is much less dramatic than it sounds and considerably more useful.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://azure.github.io/azure-sdk/general_design.html
Supports
- Client library design principles: idiomatic surfaces, consistency within a language, and treating the SDK as a product
- Service client naming, construction, lifecycle, thread safety, and per-service client scope
- Method design, sync and async parity, cancellation, pagination, and long-running operation handles
- Error handling through typed exceptions and stable error codes that distinguish client, service, and retryable failures
- Authentication through credential abstractions and token refresh
- Documentation, samples, and test expectations for released libraries
- https://azure.github.io/azure-sdk/typescript_design.html
Supports
- Language-specific guidance for naming, async methods, cancellation, and pageable and long-running-operation shapes in TypeScript clients
- https://cloud.google.com/apis/design
Supports
- Resource-oriented design background that client method shapes should mirror rather than re-imagine
- Standard and custom methods, resource names, and consistent field conventions
- https://google.aip.dev/client-libraries/4210
Supports
- Client library generators as a way to produce consistent client libraries from API definitions
- GAPIC generator behavior and the role of generated versus handwritten library parts
- https://github.com/googleapis/gapic-generator
Supports
- Google's open-source client library generator for APIs defined with gRPC and protobuf descriptors
- https://docs.stripe.com/sdks
Supports
- SDK support lifecycle and semantic versioning of client libraries
- Independent versioning of the SDK package and the pinned API version
- Stability expectations that let consumers upgrade an SDK without forcing an API upgrade
- https://semver.org/
Supports
- Major, minor, and patch semantics and the breaking-change definition
- Version communication for published client libraries
- https://spec.openapis.org/oas/v3.1.0.html
Supports
- OpenAPI revision history: Swagger 1.0 in 2011, Swagger 2.0 in 2014, donation to the OpenAPI Initiative in 2015, and later revisions
- OpenAPI as the common machine-readable input to SDK generators
- https://github.com/OpenAPITools/openapi-generator
Supports
- Generating client libraries, server stubs, and documentation from an OpenAPI document across many languages
- The project's May 2018 fork from swagger-codegen and its history
- Template customization and generated-code licensing behavior
- https://github.com/swagger-api/swagger-codegen
Supports
- The original generator that produces client libraries and server stubs from OpenAPI or Swagger descriptions
- https://smithy.io/2.0/index.html
Supports
- Smithy as a protocol-agnostic interface definition language built for code generation
- One model driving clients, servers, documentation, and OpenAPI output
- Smithy's origin at AWS and its use in generating AWS SDKs
- https://github.com/smithy-lang/smithy
Supports
- Smithy's open-source release and Apache 2.0 license
- The repository's March 2019 public creation date
- https://aws.amazon.com/blogs/developer/introducing-smithy-idl-2-0/
Supports
- Smithy IDL 2.0 release on 11 August 2022 and its code-generation improvements: reduced nulls and optionals, enums, mixins, and defaults
- https://grpc.io/blog/ga-announcement/
Supports
- gRPC 1.0 release on 23 August 2016 and a stable protocol surface for proto-driven client generation
- https://azure.microsoft.com/en-us/blog/previewing-azure-sdks-following-new-azure-sdk-api-standards/
Supports
- The July 2019 preview wave of the redesigned Azure SDKs built on open guidelines and a shared core library
- https://learn.microsoft.com/en-us/openapi/kiota/
Supports
- Kiota as a command-line generator that emits only the client surface a caller uses, building on a shared core library
- Supported languages and OpenAPI and JSON Schema coverage
- https://devblogs.microsoft.com/microsoft365dev/tailored-sdk-experiences-via-kiota-now-generally-available/
Supports
- Kiota general availability on 16 March 2023 and its strongly typed, minimal generated client model
- https://github.com/microsoft/api-guidelines
Supports
- Cross-organization naming, versioning, and error conventions that SDK authors often need to encode into client surfaces
- https://github.com/marmelab/awesome-rest
Supports
- A curated index of REST API architecture, development, test, and performance resources used to select the awesome links
- https://github.com/oapi-codegen/oapi-codegen
Supports
- Generating typed Go clients and server code from OpenAPI documents
- https://github.com/hey-api/openapi-ts
Supports
- Generating typed TypeScript clients from OpenAPI documents
- https://opensource.zalando.com/restful-api-guidelines/
Supports
- A real-world, requirements-oriented API guideline set that SDK design work references for naming, versioning, and error consistency
- https://apis.guru/
Supports
- A directory of public, OpenAPI-described APIs to practice SDK design and generator output against
- https://speakeasy.com/
Supports
- Speakeasy SDK generation, changelog, and documentation products and their proprietary, freemium positioning
- https://liblab.com/
Supports
- liblab SDK generation service and its proprietary, freemium positioning
- https://www.buildwithfern.com/
Supports
- Fern SDK and documentation generation from OpenAPI and its open-core, freemium model
- https://www.stainless.com/
Supports
- Stainless SDK generation service and its proprietary, freemium positioning
