SDK
Software Development Kit
- Pronunciation
- es-dee-KAY
In short
An SDK (software development kit) is a package of tools, libraries, documentation and examples for building software for a particular platform or service.
What is an SDK?
An SDK gathers everything a developer needs to work with one platform. The Android SDK includes the libraries for the Android APIs, build tools, an emulator and debugging tools. A cloud or service SDK, such as the AWS SDK or Stripe's SDK, mostly provides client libraries that wrap the service's API in ordinary functions for each language.
Service SDKs save a lot of repeated work. Instead of building HTTP requests, signing them, handling pagination and parsing JSON yourself, you call stripe.customers.create(...) and get a typed object back. Good SDKs also handle retries, timeouts and authentication, and are generated or kept in sync with the API so new features arrive quickly.
Platform SDKs are often tied to versions of the platform. Android and iOS apps choose a target SDK version, which decides which system features they can use and how the system treats them, and app stores require apps to keep up with recent versions over time.
A common misconception is that an SDK and an API are the same thing. The API is the interface the service offers, such as its HTTP endpoints; the SDK is a toolkit that makes using that API convenient in a particular language. You can always call the API directly without the SDK.
Key takeaways
- An SDK bundles libraries, tools, docs and examples for one platform or service.
- Platform SDKs, like Android's, include build tools and emulators.
- Service SDKs wrap an API in native functions, with auth and retries built in.
- Mobile apps target a specific SDK version of the platform.
- The API is the interface; the SDK is a toolkit for using it.
Example
// Without the SDK: build the HTTP request yourself
await fetch("https://api.stripe.com/v1/customers", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.STRIPE_SECRET_KEY}`,
"Content-Type": "application/x-www-form-urlencoded",
},
body: new URLSearchParams({ email: "ada@example.com" }),
});
// With Stripe's SDK: auth, encoding, retries and types are handled
import Stripe from "stripe";
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY);
const customer = await stripe.customers.create({ email: "ada@example.com" });Readers ask
What is the difference between an SDK and an API?
An API is the set of operations a platform or service exposes. An SDK is a kit of libraries and tools that makes calling that API easier in a specific language or platform.
What is the difference between an SDK and a library?
A library is a single piece of reusable code. An SDK is a bigger bundle that usually includes one or more libraries plus tools, documentation and samples for a platform.
Do I have to use a service's SDK?
No. Any language that can make HTTP requests can use a web API directly. SDKs simply save time and handle details such as authentication, retries and pagination for you.
Often compared
See also
- APIBackend & APIs, p. 2An API is a set of rules that lets one piece of software request data or actions from another in a predictable, documented way.
- LibraryProgramming Fundamentals, p. 34A library is a collection of ready-made code, such as functions and classes, that a program calls to do common jobs without writing that code itself.
- FrameworkProgramming Fundamentals, p. 20A framework is a reusable foundation of code, tools, and conventions that provides the structure of an application, so developers only fill in their own logic.
- REST APIBackend & APIs, p. 38A REST API is a web API that exposes data as resources identified by URLs and lets clients read or change them using standard HTTP methods.
- IDEProgramming Fundamentals, p. 26An IDE (integrated development environment) is an application that combines a code editor, a debugger, build commands and other developer tools in one place.
Spotted a mistake or something missing on this page?Suggest an edit