Feature suggestions
I have spent the day evaluating both ImageKit and Cloudinary for our business. I wanted to leave a note with some ideas and suggestions for you!
- Something similar to cloudinary's
transformationStringFromObject- manipulating strings is very tedious and confusing for developers. We should be able to leverage a higher level (and typesafe) API - Improved extensibility, why doesn't this repo expose the
ImageKitContext(it exposes something confusingly named,IKContext, which is not in fact aReact.Contextat all). If I want to do anything custom, I have to create my ownImageKit, duplicate/pass it all the same parameters that I've already passed toIKContext, including myauthenticator. All of that doesn't have to be done twice. This repo should expose theclientfor consumers to use, which would at least make it easier for them to implement custom behavior and fill any gaps until the feature set catches up.
Thanks for all your hard work!
Hey @sarink,
Thank you for taking the time to provide the valuable feedback. We really appreciate your insights and are continuously working on improving our SDKs across the board.
Regarding your point:
Something similar to cloudinary's transformationStringFromObject - manipulating strings is very tedious and confusing for developers. We should be able to leverage a higher level (and typesafe) API
Our React SDK is written in TypeScript and currently supports object-based transformations. For example, you can achieve transformations using the following syntax:
<IKImage path="/default-image.jpg" transformation={[{
"height": "200",
"width": "200"
}]} />
Could you clarify further what improvements you’re envisioning, or any specific use cases where you feel the current implementation falls short? We'd love to better understand how we can enhance the developer experience.
As for the context-related changes, we already have plans to address those in the next release, which should simplify working with custom behavior.
-
For generating transformation, we export
.urlmethod onIKCorewhich allows one to access underlying ImageKit javascript SDK:import { IKCore } from "imagekitio-react" // Generate image URL var imagekit = new IKCore({ publicKey: "your_public_api_key", urlEndpoint: "https://ik.imagekit.io/your_imagekit_id", }); //https://ik.imagekit.io/your_imagekit_id/endpoint/tr:h-300,w-400/default-image.jpg var imageURL = imagekit.url({ path: "/default-image.jpg", urlEndpoint: "https://ik.imagekit.io/your_imagekit_id/endpoint/", transformation: [{ "height": "300", "width": "400" }] }); -
Regarding why doesn't this repo expose the ImageKitContext. This is being fixed and will be released very soon. PR https://github.com/imagekit-developer/imagekit-react/pull/170
@sarink Really appreciate your feedback—thank you! We've addressed all the issues you raised in version 5.0.0, which is now live. Docs - https://imagekit.io/docs/integration/react
Not sure if you're currently using ImageKit, but if you're considering it, we'd love to support you with discounts or usage credits.
- You can now use the
buildTransformationStringutility function to generate a transformation string from an object. - The SDK now exports
ImageKitProviderandImageKitContext, which you can use anywhere in your app to access the effective value ofurlEndpointandtransformationPosition. It is a properReact.Context. IKUpload has been removed as it served no meaningful purpose in its current form. Instead, a more powerful utility function (upload) is now being exposed directly.
We’d be excited to hear what you think!
Note: This version includes breaking changes and is a significant upgrade.