This lightweight, dependency-free JavaScript SDK is designed specifically for browser use. It provides utility functions to generate image and video src URLs using ImageKit transformations and to upload files to the ImageKit media library.
For server-side applications with Node.js, please refer to our official Node.js SDK.
You can install the SDK in your project using npm or yarn.
npm install @imagekit/javascriptRefer to the ImageKit official documentation for more details on how to use the SDK.
The SDK is written in TypeScript, offering first-class TypeScript support. Enjoy excellent type safety and IntelliSense in your IDE. You can use it in your TypeScript projects without any additional configuration.
To enable type checking in JavaScript projects, add //@ts-check at the top of your JavaScript files. This will activate type checking in your IDE.
The TypeScript types in this SDK always reflect the latest shape of the ImageKit API. When we make improvements to the type definitions to better reflect the actual runtime behavior, we may release these changes in minor or patch versions. While these changes align types more closely with reality and are not breaking changes at runtime, they might cause new type errors when you upgrade.
We judge this approach to be better than the alternatives: outdated, inaccurate types, or vastly more frequent major releases that would distract from any truly breaking runtime changes. If you encounter type errors after upgrading, you can resolve them by:
- Adding appropriate type guards or assertions
- Updating your code to match the corrected types
- Using
// @ts-ignoretemporarily if you need more time to adjust
Please feel welcome to share your thoughts about the versioning policy in a GitHub issue.
For a detailed history of changes, refer to CHANGELOG.md.