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

sanity-plugin-wikimedia-image-search

v1.1.0

Published

Search Wikimedia Commons for freely-licensed images and insert them into Sanity Studio.

Readme

sanity-plugin-wikimedia-image-search

This is a Sanity Studio v5 plugin.

Search Wikimedia Commons for freely-licensed images and insert them directly into your Sanity Studio.

Features

  • Search 60M+ freely-licensed images from Wikimedia Commons by keyword
  • Browse paginated thumbnails and select one or more images
  • Images are automatically uploaded to your Sanity dataset
  • Attribution metadata (credit line, source URL, description) stored on the asset document

Installation

npm install sanity-plugin-wikimedia-image-search

Usage

Add the plugin to your Sanity configuration:

// sanity.config.ts
import {defineConfig} from 'sanity';
import {wikimediaImageSearch} from 'sanity-plugin-wikimedia-image-search';

export default defineConfig({
  // ...
  plugins: [wikimediaImageSearch()],
});

The plugin registers as an image asset source. When you open any image field, you'll see "Wikimedia Commons" as an option in the asset source dropdown.

Use as the only image source

To replace the default upload option entirely:

import {defineConfig} from 'sanity';
import {wikimediaAssetSource} from 'sanity-plugin-wikimedia-image-search';

export default defineConfig({
  // ...
  form: {
    image: {
      assetSources: () => [wikimediaAssetSource],
      directUploads: false,
    },
  },
});

Use on a single field

import {wikimediaAssetSource} from 'sanity-plugin-wikimedia-image-search'

{
  name: 'photo',
  title: 'Photo',
  type: 'image',
  options: {
    sources: [wikimediaAssetSource],
  },
}

How It Works

  1. Open an image field and select Wikimedia Commons from the asset source dropdown
  2. Search by keyword — results come from the Wikimedia Commons MediaWiki API (action=query with generator=search)
  3. Browse paginated thumbnails and select images
  4. Selected images are downloaded from Wikimedia and uploaded to your Sanity dataset
  5. Attribution is stored on the asset document (creditLine, source, description)

No API key is required — the Wikimedia Commons API is free and public.

Attribution

All images from Wikimedia Commons are freely licensed. The plugin stores attribution metadata on each asset document, including:

  • source.name: "wikimedia-commons"
  • source.url: Link to the file's Wikimedia Commons page (with full license and creator info)
  • creditLine: "Wikimedia Commons"

You can use this metadata to display proper attribution on your site.

Requirements

  • Sanity Studio v5
  • React 19.2+

Develop & test

This plugin uses @sanity/plugin-kit with default configuration for build & watch scripts.

See Testing a plugin in Sanity Studio on how to run this plugin with hotreload in the studio.

Useful commands

npm run build    # Build the plugin
npm run watch    # Watch for changes and rebuild
npm run lint     # Lint the codebase
npm run format   # Format with Prettier

Release

This repo uses semantic-release in the CI & Release workflow.

Commit types and version bumps

Release behavior follows @semantic-release/commit-analyzer default rules:

  • feat: => minor release
  • fix: => patch release
  • perf: => patch release
  • BREAKING CHANGE: footer => major release
  • chore:, docs:, style:, test:, and other unmatched commit types => no release

Reference: semantic-release/commit-analyzer

Triggering a release

Run the CI & Release workflow on main with Release new version enabled.

If there are no releasable commits since the latest tag, semantic-release will skip publishing.

License & Content Rights

  • The plugin source code in this repository is licensed under MIT.
  • Images imported from Wikimedia Commons are not covered by this MIT license.
  • Each imported asset keeps its own upstream license terms (for example, CC BY, CC BY-SA, Public Domain), which are shown on the file description page.
  • You are responsible for complying with the license terms of each imported image, including attribution and share-alike requirements where applicable.
  • The plugin stores attribution metadata (source, creditLine, and description) to help you render proper credit in your project.

MIT © Simon Gowing