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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ccatto/imagekit

v1.1.1

Published

Catto ImageKit — reusable ImageKit upload auth signer, client upload, URL transforms, and a React upload component. No keys embedded; the consuming app injects them.

Readme

@ccatto/imagekit

Reusable ImageKit helpers for React/Next.js apps: a client uploader, URL transforms, ready-made React components, and a server-only auth signer. No keys are embedded — the consuming app injects its public key (client) and private key (server), so this package is safe to share across apps.

  • Client: uploadToImageKit, buildImageKitUrl, <ImageUploadCatto>, <ImageGalleryCatto>
  • Server (@ccatto/imagekit/server): createImageKitAuthParams — HMAC-SHA1 upload-auth signer. Ships from a separate subpath so Node crypto and your private key never reach the client bundle.

Install

yarn add @ccatto/imagekit

Peer deps: react / react-dom (>=18). No other runtime deps.

Plug-n-play setup (3 steps)

1. Add the server auth route

The browser needs short-lived signed params to upload directly to ImageKit. Sign them server-side with your private key (never shipped to the client):

// app/api/imagekit-auth/route.ts  (Next.js App Router)
import { NextResponse } from 'next/server';
import { createImageKitAuthParams } from '@ccatto/imagekit/server';

export async function GET() {
  const privateKey = process.env.IMAGEKIT_PRIVATE_KEY;
  if (!privateKey) {
    return NextResponse.json({ error: 'not configured' }, { status: 500 });
  }
  return NextResponse.json(createImageKitAuthParams(privateKey));
}

createImageKitAuthParams(privateKey, expireSeconds = 1800) returns { token, expire, signature } — only those three values go to the browser.

2. Drop in the uploader

import { ImageUploadCatto } from '@ccatto/imagekit';

<ImageUploadCatto
  publicKey={process.env.NEXT_PUBLIC_IMAGEKIT_PUBLIC_KEY!}
  folder="/pickle-paddle-reviews"
  value={imageUrl}
  onUploaded={(url) => setImageUrl(url)}
  onError={(err) => console.error(err)}
/>;

Or upload imperatively:

import { uploadToImageKit } from '@ccatto/imagekit';

const result = await uploadToImageKit(file, {
  publicKey: process.env.NEXT_PUBLIC_IMAGEKIT_PUBLIC_KEY!,
  folder: '/pickle-paddle-reviews',
  authUrl: '/api/imagekit-auth', // default
});
// result.url is the CDN URL

3. Set env vars

NEXT_PUBLIC_IMAGEKIT_PUBLIC_KEY=public_xxx   # safe in the client
IMAGEKIT_PRIVATE_KEY=private_xxx             # server only — never expose

Displaying images

import { ImageGalleryCatto, buildImageKitUrl } from '@ccatto/imagekit';

// Multi-image viewer with thumbnails (auto-applies ImageKit transforms).
<ImageGalleryCatto images={urls} alt="Paddle" mainWidth={800} thumbWidth={120} />;

// Or build a transformed URL directly.
const thumb = buildImageKitUrl(url, { width: 200, quality: 80, format: 'auto' });

ImageKitTransform: { width?, height?, quality?, format?: 'auto'|'webp'|'jpg'|'png'|'avif', crop? }. buildImageKitUrl returns non-ImageKit URLs unchanged, so it's safe to call on any src.

Exports

| Import | From | Kind | | --- | --- | --- | | uploadToImageKit, buildImageKitUrl | @ccatto/imagekit | client helpers | | ImageUploadCatto, ImageGalleryCatto | @ccatto/imagekit | React components | | createImageKitAuthParams | @ccatto/imagekit/server | server-only signer |

License

MIT