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

app-icon-badge-next

v0.2.0

Published

Production-ready app icon badging for Expo and React Native: overlay environment and version badges on iOS and Android app icons via an Expo config plugin, library API, or CLI.

Readme


About

app-icon-badge-next is the production-ready successor to app-icon-badge, focused on reliability in CI/EAS, support for modern Expo icon models, and predictable results across current iOS and Android launcher behavior.

Motivation

Mobile teams often install multiple builds of the same app (development, QA, staging, production). When icons look identical, QA and debugging slow down.

app-icon-badge-next overlays clear environment/version badges on icons so builds are easy to identify at a glance.

Features

  • Expo config plugin and library API support.
  • Platform-aware badge configuration:
    • shared badges
    • ios.badges
    • android.badges
  • Android adaptive icon safe-zone support (adaptiveSafeMode, android.safeZoneScale).
  • Badge text controls: fontScale, padding, letterSpacing, opacity.
  • Deterministic cache support to skip unchanged generations.
  • Debug and dry-run modes for safer CI usage.
  • Expo 54+ icon model handling (root icon, Android icon + adaptive foreground, iOS string and object variants).

Installation

# yarn
yarn add app-icon-badge-next

# npm
npm install app-icon-badge-next

# pnpm
pnpm add app-icon-badge-next

Usage

Expo Plugin

// app.config.ts
import type { ConfigContext, ExpoConfig } from '@expo/config';
import type { AppIconBadgeConfig } from 'app-icon-badge-next/types';

const VERSION = '1.0.1';
const APP_ENV = 'QA';

const appIconBadgeConfig: AppIconBadgeConfig = {
  enabled: true,
  cache: true,
  debug: false,
  dryRun: false,
  adaptiveSafeMode: true,
  badges: [
    {
      text: APP_ENV,
      type: 'banner',
      color: 'white',
      background: '#FF0000',
      fontScale: 1,
      padding: 0,
      letterSpacing: 0,
      opacity: 1,
    },
  ],
  ios: {
    badges: [
      { text: VERSION, type: 'ribbon', position: 'right' },
    ],
  },
  android: {
    safeZoneScale: 0.72,
    badges: [
      { text: VERSION, type: 'ribbon', position: 'right' },
    ],
  },
};

export default ({ config }: ConfigContext): ExpoConfig => ({
  ...config,
  name: 'my-app',
  icon: './assets/icon.png',
  android: {
    icon: './assets/icon-android.png',
    adaptiveIcon: {
      foregroundImage: './assets/adaptive-icon.png',
      backgroundColor: '#FFFFFF',
    },
  },
  plugins: [['app-icon-badge-next', appIconBadgeConfig]],
});

Plugin option summary (defaults in parentheses):

  • enabled: enable or disable generation (true).
  • badges: shared badge layers for all platforms.
  • ios.badges: iOS-only badge layers (falls back to badges).
  • android.badges: Android-only badge layers (falls back to badges).
  • android.safeZoneScale: safe-zone scale for adaptive foreground, 0.4-1 (0.72).
  • adaptiveSafeMode: apply safe-zone transform for adaptive icons (true).
  • cache: deterministic cache for unchanged inputs (true).
  • debug: structured debug logs (false).
  • dryRun: skip file writes (false).

The plugin rewrites configured icon paths to fixed outputs under .expo/app-icon-badge and generates the badged images at that moment (synchronously, before Expo's own icon handling reads them). A deterministic cache keyed on source bytes + badge config makes repeat evaluations no-ops, and the plugin is idempotent when Expo re-applies it to an already rewritten config.

Source: https://github.com/AdzeB/app-icon-badge-next/blob/main/src/plugin/app.plugin.ts

As a Library

import { addBadge } from 'app-icon-badge-next';
import path from 'node:path';

const icon = path.resolve(__dirname, './assets/icon.png');

await addBadge({
  icon,
  dstPath: './assets/icon.environment.png',
  badges: [
    {
      text: 'staging',
      type: 'banner',
      color: 'white',
      background: '#FF0000',
      fontScale: 1,
      padding: 0,
      letterSpacing: 0,
      opacity: 1,
    },
    {
      text: '1.0.1',
      type: 'ribbon',
      position: 'right',
    },
  ],
  isAdaptiveIcon: false,
  adaptiveSafeMode: true,
  safeZoneScale: 0.72,
  debug: false,
  dryRun: false,
});

All options except icon and badges are optional. Defaults: isAdaptiveIcon: false, adaptiveSafeMode: true, safeZoneScale: 0.72, debug: false, dryRun: false. Omitting dstPath writes next to the source as <name>.result.<ext>.

CLI

Run the CLI:

npx app-icon-badge-next --help

Command help:

Usage: app-icon-badge-next [options] [command]

Generate app icons with badges

Options:
  -V, --version                   output the version number
  -h, --help                      display help for command

Commands:
  add-badge [options] <iconPath>
  help [command]                  display help for command

add-badge options:

Usage: app-icon-badge-next add-badge [options] <iconPath>

Options:
  --text <text>              badge text
  --type <type>              badge type: banner | ribbon
  --position <position>      banner: top | bottom, ribbon: left | right
  --background <background>  badge background as #rrggbb
  --color <color>            badge text color: white | black (default: "white")
  --platform <platform>      target platform: ios | android | all (default: "all")
  --preview                  write result to preview path (default: false)
  --safe-zone                enable adaptive safe zone (default: false)
  --scale <scale>            safe zone scale (0.4-1) (default: "0.72")
  --dry-run                  no file write (default: false)
  --debug                    debug logs (default: false)
  -h, --help                 display help for command

Example:

npx app-icon-badge-next add-badge ./assets/icon.png \
  --type banner \
  --text QA \
  --position top \
  --background '#45f4ee' \
  --color black \
  --platform all \
  --safe-zone \
  --scale 0.72

Contributing

Contributions are welcome! See the contributing guide for setup, workflow, and release details.

pnpm install     # install dependencies
pnpm type-check  # TypeScript type checking
pnpm build       # build dist/
pnpm test        # run tests (requires a prior build)

Releases are automated with Changesets; see CHANGELOG.md for release notes.

Special Thanks and License Attribution

Special thanks to the original project and maintainers:

License agreement and attribution:

  • app-icon-badge-next is MIT licensed.
  • The original obytes/app-icon-badge project is MIT licensed.
  • This successor preserves attribution to the original work and follows MIT license terms for reuse and distribution.

License

MIT. See LICENSE.