SDK Kit
A blueprint for building JavaScript SDKs
SDK Kit provides a composable, plugin-based architecture for building type-safe, tree-shakeable JavaScript SDKs. Built with TypeScript and designed for modern development workflows, it offers the flexibility of a minimal core with the power of capability-based plugins. Whether you’re shipping a client library for your API, building a browser SDK for your product, or learning how modern SDKs work—SDK Kit gives you the patterns to create something production-ready.
Latest Release: v0.2.0 — Core framework, essential plugins, and plugin extensibility (hold/hasCapability)
Why SDK Kit?
Building a JavaScript SDK from scratch is hard. You need to figure out architecture, plugin systems, configuration management, events, storage, and more. SDK Kit gives you a proven blueprint:
- Functional Plugins - Pure functions with explicit dependencies, no classes or hidden state
- Event-Driven Coordination - Plugins communicate through events with wildcard patterns
- Type-Safe - Full TypeScript support throughout
- Tree-Shakeable - Users only bundle what they use
- Battle-Tested Patterns - Architecture proven in production SDKs
- Essential Building Blocks - 6 plugins covering storage, context, transport, queuing, polling, and consent
- Learn by Building - Understand how modern SDKs work by creating your own
Quick Start
Build your first SDK in minutes:
Install
npm install @lytics/sdk-kit @lytics/sdk-kit-pluginsCompose Your SDK
import { SDK } from '@lytics/sdk-kit'
import { storagePlugin, contextPlugin, transportPlugin } from '@lytics/sdk-kit-plugins'
// Build your SDK from composable plugins
const mySDK = new SDK()
mySDK.use(storagePlugin)
mySDK.use(contextPlugin)
mySDK.use(transportPlugin)
await mySDK.init({
storage: { namespace: 'mycompany' },
transport: { endpoint: 'https://api.mycompany.com' }
})Ship It
// Your SDK is ready to use
mySDK.storage.set('userId', '123')
const context = mySDK.context.get()
await mySDK.transport.send({
event: 'pageview',
context
})
// Export and publish to npm for your users
export default mySDKProject Status
Phase 3 Complete! Plugin extensibility with hold() and hasCapability() ready for production use.
Core Framework:
- Core SDK with plugin system
- 6 capabilities (Emitter, Config, Namespace, Expose, Requirer, Extensible)
- Plugin-to-plugin communication via hold()
- 219 tests with >90% coverage
- Full TypeScript support
Essential Plugins:
- Storage (localStorage/sessionStorage/cookies/memory)
- Context (browser/device detection)
- Poll (async resource polling)
- Queue (batching & persistence)
- Transport (fetch/beacon/pixel/XHR)
- Consent (OneTrust/CookieBot)
- Logging (Pino with privacy-first design)
Learn More
- Getting Started - Build your first SDK
- Core Concepts - Understand the architecture
- Plugin Guide - Create custom plugins
- Plugin Extensibility - Plugin-to-plugin capabilities (Phase 3)
Experiment and Learn — SDK Kit is open source and MIT licensed. Use it to ship production SDKs, prototype ideas, or learn how modern SDK architecture works. Built by Lytics, refined in production, shared with the community.