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

@madebywild/sanity-media-field

v1.3.0

Published

> [!IMPORTANT] > This package is primarily intended for internal use.

Downloads

505

Readme

[!IMPORTANT] This package is primarily intended for internal use.

@madebywild/sanity-media-field

Sanity media field that combines image, video, and motion inputs.

Install

pnpm add @madebywild/sanity-media-field

Configure Plugin

import { defineConfig } from "sanity";
import { wildSanityMediaFieldPlugin } from "@madebywild/sanity-media-field";

export default defineConfig({
  plugins: [wildSanityMediaFieldPlugin()],
});

Use in Schema

import { defineField } from "sanity";
import { requireMedia } from "@madebywild/sanity-media-field";

defineField({
  name: "heroMedia",
  type: "wild.media",
  validation: (R) => requireMedia(R),
  options: {
    inline: true,
    allowedKinds: ["image", "video"],
    disallowedKinds: ["motion"],
    // enabled by default; supports a boolean or { enabled, altText, imagePrompt }
    aiAssistant: { imagePrompt: false },
    extensions: {
      // each supports `true` or { enabled: true/false }
      caption: true,
      customRatio: { enabled: true },
      videoOptions: { enabled: true },
    },
  },
});

AI Assistant

The media field integrates with Sanity AI Assist. When enabled, the image input gains:

  • an altText field that AI Assist automatically fills with a generated image description whenever the image changes.
  • an imagePrompt field that generates a new image asset from the prompt when an AI Assist instruction writes to it.

Requires @sanity/assist to be installed and configured in the studio. Without it, the fields still render but stay inert: nothing is ever generated, and imagePrompt does nothing. If your studio doesn't use AI Assist, consider disabling imagePrompt (or the assistant entirely) to avoid showing a dead field.

The AI assistant and both of its features are enabled by default and stay enabled unless explicitly disabled in the plugin config or on the field level. Both levels are merged per option, with field-level options taking precedence:

// Plugin level: disable the image prompt field for all media fields.
wildSanityMediaFieldPlugin({ aiAssistant: { imagePrompt: false } });

// Field level: overrides the plugin config per option.
defineField({
  name: "heroMedia",
  type: "wild.media",
  options: {
    // Disable the AI assistant entirely for this field...
    aiAssistant: false,
    // ...or toggle individual features:
    // aiAssistant: { imagePrompt: true, altText: false },
  },
});

Disabling the AI assistant (at either level) only hides the inputs. The altText and imagePrompt fields remain part of the schema, and existing values are preserved and stay queryable via GROQ. In a studio with @sanity/assist installed, alt text auto-generation still runs when the image changes, even where the field is hidden. The only way to fully opt out of the AI Assist behavior is to not install @sanity/assist in the studio.