
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
imagekit-react
Advanced tools
Simple package to use the ImageKit service inside of React apps.
npm install --save imagekit-react
Currently, there are two major ways to use the image delivery component of ImageKit in React.
You pass the following data, using which the complete URL is constructed.
urlEndpoint: Easily obtained from your ImageKit dashboard.path: The path to the image you'd like to fetch.transformations: The transformations you would like to apply on a given image.alt: Alt text of the image.<Image
urlEndpoint="https://ik.imagekit.io/demo/"
path="medium_cafe_B1iTdD0C.jpg"
transformations={transformations}
/>
If you've saved the complete URL of images in your DBs, then using just a URL and applying transformations on that might be a better option for you.
<Image
transformations={transformations}
src="https://ik.imagekit.io/demo/medium_cafe_B1iTdD0C.jpg"
/>
Transformations in imagekit-react are just arrays of objects. Each of these objects specifies the transformations you need.
const transformations = [{
w: 90,
h: 120
}];
The above snippet will apply transformations of width=90 and height=120 on the image.
Some transforms are destructive and you might want to control the order in which the transforms are applied. In which case there are...
Chained transforms make it easy to specify the order in which the transforms are applied. For example if both resizing and rotation transforms are present. Then changing the order of the transforms changes the output image.
So a simple way to chain transforms in imagekit-react is to enter another element in the array of objects. The first object is always executed first and so on.
const transformations = [
{
rt: 90
},
{
w: 100,
ar: "16-9"
}
];
In the above case, rotation will be performed first and resizing according to width and aspect ratio will be performed afterwards.
ImageKit supports a lot more features. But many (some involving private keys, etc.) cannot be implemented on a client side library like imagekit-react.
FAQs
ImageKit SDK for React
We found that imagekit-react demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.