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

datocms-plugin-alt-text-ai

v0.6.1

Published

Generate alt text with AltText.ai, OpenAI, Anthropic Claude, or Google Gemini

Readme

Alt Text AI

Generate alt text for image assets from DatoCMS file and gallery fields or directly in the Media Area. Choose AltText.ai, OpenAI, Anthropic Claude, or Google Gemini.

Supported providers

| Provider | Required settings | | --- | --- | | AltText.ai | AltText.ai API key | | OpenAI | OpenAI API key and an image-input model | | Anthropic Claude | Anthropic API key and an image-input model | | Google Gemini | Gemini API key and an image-input model |

For direct model providers, the plugin loads every model ID returned by the provider's model-list API after an API key is entered. It does not recommend or preselect a model. Choose one that accepts image input and returns text, or enter a model ID manually.

Configuration

  1. Grant the plugin the currentUserAccessToken permission when installing it. The plugin needs this permission to retrieve selected assets and update their default metadata in the current DatoCMS environment.
  2. Open the plugin settings and choose an alt text provider.
  3. Enter that provider's API key.
  4. For OpenAI, Anthropic, or Gemini, select or enter a vision-capable model and review the prompt template.
  5. Save the settings.

The prompt template for direct model providers supports these placeholders:

  • {locale}: the active record locale for field actions, or the project locale being generated in Media Area actions.
  • {filename}: the asset filename, supplied as supporting context.

Keep an instruction in the prompt that asks the provider to return only the alt text. AltText.ai uses its own generation configuration rather than this prompt template.

Existing installations

Existing installations are migrated automatically. A previously saved apiKey remains associated with AltText.ai, and AltText.ai remains the selected provider until you choose another one.

Where to generate alt text

The plugin adds the same two actions in three places: Generate missing alt texts and Regenerate all alt texts.

1. A file or gallery field

Open the actions menu on a populated file or gallery field.

Alt text generation actions in a populated DatoCMS file field

2. Selected assets in the Media Area

Select one or more images, then open the bulk actions menu in the selection bar.

Alt text generation actions for selected assets in the DatoCMS Media Area

3. An open asset in the Media Area

Open an image asset, then use the asset actions menu beside its filename.

Alt text generation actions on an open DatoCMS image asset

How the actions work

All three locations offer the same choices:

  • Generate missing alt texts fills assets whose alt text is empty and leaves existing alt text unchanged.
  • Regenerate all alt texts generates alt text for every targeted image and overwrites existing values.

In a record field, generated values update the current form and are not saved automatically. Review the output, make any necessary edits, and save the record.

For localized fields, the plugin reads and updates only the field value for the active locale. Run the action separately in each locale that needs alt text. It does not update asset metadata globally or change other fields and records that reference the same upload.

In the Media Area, the same actions are available after selecting multiple uploads and inside an individual asset. The plugin generates default alt text for every project locale and saves it immediately to each upload. Non-image files are skipped. Regenerate all alt texts asks for confirmation before replacing saved upload defaults.

For larger Media Area runs, the plugin shows occasional aggregate progress updates with the number of locale versions processed and assets finished. Updates are throttled so they remain useful without creating a notification for every image or locale.

Media Area actions change the upload's global default metadata. They do not replace explicit alt text overrides already stored in record fields.

Security and privacy

Provider API keys are stored in the plugin parameters and used by client-side requests from the DatoCMS editor. Anyone who can run or inspect the plugin in that project may be able to retrieve those keys. Use dedicated keys with the narrowest available permissions, quotas, billing limits, and origin or API restrictions, and rotate them regularly. If your organization's policy prohibits browser-exposed credentials, do not configure a direct provider key.

The data sent depends on the selected provider. AltText.ai receives a transformed public image URL, the active locale, and a stable identifier derived from the DatoCMS upload ID. OpenAI and Anthropic receive the transformed public image URL plus the expanded prompt. Gemini receives the image bytes plus the expanded prompt. The expanded prompt contains the locale or filename only when its template includes the corresponding placeholder. Review the selected provider's data-handling terms before processing sensitive assets.

The editor's DatoCMS current-user access token is used only to retrieve uploads and update their default metadata through the Content Management API for the current environment. It is never sent to AltText.ai, OpenAI, Anthropic, or Google.

Limitations and accessibility notes

  • The plugin is intended for image assets. Other file types are not supported and may produce a provider error.
  • Direct providers require a model that accepts image input and returns text. Model availability, pricing, rate limits, and output quality depend on the provider account.
  • Each asset-generation request times out after 60 seconds without changing that asset's alt text.
  • AI-generated descriptions can be inaccurate. Always review them in the context where the image appears.
  • Empty alt text can be intentional for decorative images. Generate missing alt texts cannot distinguish an intentional empty value from a missing one, so review decorative images before saving.
  • A single asset can need different alt text in different contexts. Field actions update only the current occurrence; Media Area actions update the upload defaults inherited where no explicit field-level override exists.

Development

Run commands from this directory:

  • npm run dev: start the local Vite development server.
  • npm run build: type-check the project and build production assets into dist/.
  • npm run test: run the test suite once.
  • npm run test:watch: run tests in watch mode.
  • npm run preview: preview the production build locally.