@besar1/simple-sdk
v1.5.0
Published
A simple SDK with version management and configuration
Readme
Simple SDK
A simple, configurable SDK with version management support for both npm and CDN usage.
Installation
NPM
npm install simple-sdk
# or
pnpm add simple-sdk
# or
yarn add simple-sdkCDN (UMD)
<script src="https://unpkg.com/simple-sdk@latest/dist/index.umd.js"></script>Usage
ES Modules / CommonJS
import { SimpleSDKClient } from 'simple-sdk';
// or
const { SimpleSDKClient } = require('simple-sdk');
const client = new SimpleSDKClient({
package: 'npm',
version: '1.0.0' // optional, defaults to 'latest'
});
// Use the SDK
const result = await client.doSomething();
console.log(result);UMD (Browser)
<script src="https://unpkg.com/simple-sdk@latest/dist/index.umd.js"></script>
<script>
const client = new SimpleSDK.SimpleSDKClient({
package: 'umd',
version: 'latest'
});
client.doSomething().then(result => {
console.log(result);
});
</script>API
SimpleSDKClient
Constructor
new SimpleSDKClient(config: SDKConfig)Configuration
interface SDKConfig {
package: 'npm' | 'umd';
version?: string | 'latest';
}Methods
doSomething(): Promise<string>- Example method that returns a success messagegetConfig(): SDKConfig- Returns the current configurationgetVersion(): string- Returns the current version
Features
- ✅ TypeScript support
- ✅ Multiple build formats (ESM, CJS, UMD)
- ✅ Version management
- ✅ CDN ready
- ✅ Tree-shakeable
- ✅ Zero dependencies
License
MIT
