Introduction#
Pixkit-sdk is the official JavaScript/TypeScript SDK for PixKit — a lightweight, type-safe library for image uploads, dynamic transformations, AI-powered processing, and CDN-optimized delivery.
⚡
Direct Uploads
Files go straight to S3 via pre-signed URLs — zero server bottlenecks.
🔄
On-the-fly Transforms
Resize, format conversion, quality tuning, and AI processing via URL params.
🔐
Secure Deletion
Server-side file removal with secret-key authentication.
🦾
Type-Safe
Full TypeScript definitions with IntelliSense support out of the box.
🧩
Framework Agnostic
Works with React, Next.js, Node.js, Express, NestJS, and any modern JS runtime.
🤖
AI-Powered
Background removal and upscaling via AI transformation parameters.
Installation#
Install @nickdjangir/pixkit-sdk using your preferred package manager:
Bash
npm install @nickdjangir/pixkit-sdkCDN (Browser)#
You can also load the SDK directly via a <script> tag:
HTML
<script src="https://unpkg.com/@nickdjangir/pixkit-sdk/dist/index.global.js"></script>
<script>
const pixkit = new PixKitSDK.PixKit({
publicKey: 'YOUR_PUBLIC_KEY',
secretKey: 'YOUR_SECRET_KEY',
projectId: 'YOUR_PROJECT_ID',
});
</script>Danger
Never expose your secretKey in client-side code. Use CDN loading only for prototyping or when calling url() (which does not require a secret key).
Getting Started#
Here's a complete example showing initialization, URL generation, upload, and deletion:
TypeScript
1