npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

netlify-plugin-imagekit

v1.0.0

Published

The npm package helps in serving assets like images directly from imagekit apis helping in optimizing it.

Downloads

11

Readme

ImageKit Netlify plugin

Node CI npm version License: MIT Twitter Follow

The plugin seamlessly integrates with your Netlify site, delivering high-quality optimized images using ImageKit.

Prerequisites

Before starting, you need an ImageKit account to use the plugin. Then, you must set up a URL endpoint pointing to a web proxy origin, as described below.

  • Add web proxy origin by following these steps.

  • Add the above web proxy origin as the URL endpoint by following these steps.

After following the above steps, you will have the ImageKit URL endpoint.

https://ik.imagekit.io/{imagekit_id}/{origin_identifier}

Setup ImageKit Netlify plugin

Currently, you can integrate the plugin with the help of file-based installation.

File-based installation

Add the plugin to your Netlify configuration file netlify.toml:

[[plugins]]
  package = "netlify-plugin-imagekit"

Add the ImageKit URL endpoint:

[[plugins]]
  package = "netlify-plugin-imagekit"

  [plugins.inputs]
  urlEndpoint = "https://ik.imagekit.io/{imagekit_id}/{origin_identifier}"

Note: You can also set IMAGEKIT_URL_ENDPOINT env variable as an alternative to providing urlEndpoint in a plugin input. The environment variable can be set in multiple ways through Netlify UI, Netlify API, or Netlify CLI. You can also pass environment variable through Netlify configuration file netlify.toml.

Optionally adding imagesPath:

 [[plugins]]
  package = "netlify-plugin-imagekit"

  [plugins.inputs]
  urlEndpoint = "https://ik.imagekit.io/{imagekit_id}/{origin_identifier}"
  imagesPath = ["/my-image-path","my-image-path-two"] // default value is set to "images"

It specifies the paths, relative to the publish directory, where images are stored and should be served through the ImageKit server. If images are stored in multiple directories, you can provide an array to imagesPath, and all such images will be redirected to ImageKit. If no value is provided, the default value is set to images.

Publish Directory: When deploying a front-end project on Netlify, the deployment is done after running the build command, which generates a folder containing the build output. The name of this folder can vary depending on the framework being used. For example, the folder might be named build or dist in a React project. This folder's path must be specified as the publish directory in Netlify.

Find a comprehensive list of build commands and publish directories for various frameworks on Netlify here.

Lastly, add netlify-plugin-imagekit as a dev dependency as mentioned here.

// using npm
npm install -D netlify-plugin-imagekit

// using yarn 
yarn add --dev netlify-plugin-imagekit

After following the above steps, the ImageKit plugin will work out of the box. Internally, it uses the mechanism described here to deliver highly optimized images.

Limitations

  • When external or third-party URLs are used instead of static assets in frameworks like React that do not generate HTML files after the build process or mutate the DOM on the client side, these URLs will not be replaced by ImageKit URLs. To address this issue, you can use the ImageKit client-side SDK, imagekit-react to serve third-party URLs through the ImageKit server.

  • Another limitation is that when base64 URLs are used for images, no separate request is made to the backend to fetch the images. As a result, these images cannot be replaced.

Support

For any feedback or to report any issues or general implementation support, please reach out to [email protected]

Links

License

Released under the MIT license.