Putting Kit back in SDK
@Darrel_Miller
How do you
feel about
SDKs for APIs?
This Photo by Unknown Author is licensed under CC BY-SA-NC
Do they make
you feel like this?
This Photo by Unknown Author is licensed under CC BY-NC-ND
TTFC
This Photo by Unknown Author is licensed under CC BY-SA
Made by a machine
This Photo by Unknown Author is licensed under CC BY-SA
This is what
we need
Kit Components
Client
Factory
Request
Builder
Response
Handler
HTTP
Interface
Request Response
Middleware
HTTP
Handler
Service
Client
Core Library
Native Library
API Models
Common
Content
Generated Library
Tasks
Workflow
Support for scenarios
where a coordinated set
of HTTP requests achieve
a common goal
Services types for
simplified payload
handling
Handling standard
responsecodes and
deserialization of payloads
Components for
applying cross
cutting concerns
Common container
models for collections,
paging, batch, Multi-part
Provide discovery
mechanism for
resources and
parameters
Provide simple,
language native,
interface for
common use cases
Create native client library
with desired configuration
and middleware
Middleware magic
This Photo by Unknown Author is licensed under CC BY
Http
Client
Service
Auth
Handler
Request
Application
Response
Retry
Handler
Redirect
Handler
Caching
Handler …
OAuth
Provider
StorageProvider
Request
Context
User
Middleware
Controls
Request Queue
Request vs
Content
This Photo by Unknown Author is licensed under CC BY-NC-ND
Http
Client
Fluent
Request
Builder
Status
Monitor
Content
Webhook
Content
Request Response
Templated
Request
Builder
Domain
Types
Body
Multipart
Content
Entity
Content
Collection
Content
Error
Content
GraphQL
Request
Content
GraphQL
Response
Content
Subscribe
Content
Content is
composable
This Photo by Unknown Author is licensed under CC BY
Signed/Encrypted
Content
Signed/Encrypted
Content
Compressed
Content
Multipart
Content
Streaming
Content
Collection
Content
Content
Headers
Trailer
Headers
Tasks – Higher
order
functions
This Photo by Unknown Author is licensed under CC BY-NC-ND
SomeTask
Current State
Http Client API
Request
Response
Input
Parameters
State Change
Event
Action
PageIterator Task
let somePagedCollection: PageCollection = await client.api("/me/messages").get();
let callback: PageIteratorCallback = (data) => {
console.log(data);
return true;
};
let pageIterator = new PageIterator(client, somePagedCollection, callback);
await pageIterator.iterate();
Response Handler
This Photo by Unknown Author is licensed under CC BY-NC
Response Machine
Application
State
DispatcherAPI Response
Response
Callback
Response
Callback
Response
CallbackResponse
Callback
Status, Content-Type,
Link Relation
• Generated code is only a small part of
SDKs
• SDKs can and should add value to all
developers
• Don’t hide the HTTP model
This Photo by Unknown Author is licensed under CC BY-NC-ND

APIdays Paris 2018 - Putting the Kit back in SDKs Darrel Miller, Senior Software Engineer, Microsoft