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

@updateddev/widget

v0.3.6

Published

Release notes widget for Updated.dev

Readme

@updateddev/widget

Release notes widget for Updated.dev - Display beautiful release announcements in your app.

npm version license

Features

  • Lightweight - Only ~12KB (gzipped), actual widget loads from CDN
  • Zero dependencies - No runtime dependencies, React is optional
  • Multiple integrations - React component, vanilla JS, or script tag
  • Next.js support - Works with App Router ("use client" included)
  • Theme support - Light, dark, and auto (system) themes
  • Mobile responsive - Toast notifications on mobile, modal on desktop
  • User tracking - Track which users have seen releases
  • TypeScript - Full type definitions included

Installation

npm / yarn / pnpm

npm install @updateddev/widget
# or
yarn add @updateddev/widget
# or
pnpm add @updateddev/widget

Script Tag (CDN)

<script
  src="https://widget.updated.dev/v1.js"
  data-key="your-client-key"
></script>

Quick Start

React / Next.js (with Provider - Recommended)

import {
  UpdatedWidgetProvider,
  useUpdatedWidget
} from '@updateddev/widget/react';

// App.tsx - Wrap your app with the provider
function App() {
  return (
    <UpdatedWidgetProvider
      clientKey="wk_xxx"
      position="bottom-right"
      theme="auto"
    >
      <MyComponent />
    </UpdatedWidgetProvider>
  );
}

// Any child component can use the hook
function MyComponent() {
  const { openReleaseNoteList, openLastReleaseNote, close } = useUpdatedWidget();

  return (
    <button onClick={openReleaseNoteList}>
      What's New
    </button>
  );
}

React / Next.js (Standalone)

import { UpdatedWidget } from '@updateddev/widget/react';

function App() {
  return (
    <UpdatedWidget
      clientKey="wk_xxx"
      position="bottom-right"
    />
  );
}

Vanilla JavaScript

import { UpdatedWidget } from '@updateddev/widget';

// Initialize
UpdatedWidget.init({
  clientKey: 'wk_xxx',
  position: 'bottom-right',
  theme: 'auto',
});

// Control the widget
UpdatedWidget.open();        // Open latest release
UpdatedWidget.openHistory(); // Open release history
UpdatedWidget.close();       // Close the widget
UpdatedWidget.destroy();     // Remove widget from DOM

Script Tag

<script
  src="https://widget.updated.dev/v1.js"
  data-key="wk_xxx"
  data-position="bottom-right"
  data-theme="auto"
></script>

<script>
  // Programmatic control via global API
  window.UpdatedWidget.openReleaseNoteList();
  window.UpdatedWidget.openLastReleaseNote();
  window.UpdatedWidget.close();
</script>

Configuration

React Props / Vanilla JS Config

| Option | Type | Default | Description | |--------|------|---------|-------------| | clientKey | string | required | Your widget client key from Updated.dev | | position | string | "bottom-right" | Position: "bottom-right", "bottom-left", "top-right", "top-left", "center" | | theme | string | "auto" | Theme: "light", "dark", "auto" | | autoOpen | boolean | true | Auto-open modal when new releases are available | | autoOpenDelay | number | 1500 | Delay before auto-open (ms) | | limit | number | 10 | Maximum number of releases to fetch | | userId | string | - | User ID for server-side seen tracking | | email | string | - | User email (adds user to audience) | | name | string | - | User display name | | debug | boolean | false | Enable debug logging | | useMockData | boolean | false | Use mock data (requires debug: true) | | apiUrl | string | - | Override API backend URL | | scriptUrl | string | - | Override script URL (for development) | | offsetTop | number | 0 | Top offset in pixels (desktop only) | | offsetRight | number | 0 | Right offset in pixels (desktop only) | | offsetBottom | number | 0 | Bottom offset in pixels (desktop only) | | offsetLeft | number | 0 | Left offset in pixels (desktop only) |

Script Tag Attributes

| Attribute | Description | |-----------|-------------| | data-key | Your widget client key (required) | | data-position | Widget position | | data-theme | Theme setting | | data-auto-open | Auto-open behavior ("true" / "false") | | data-user-id | User ID for tracking | | data-email | User email | | data-name | User display name | | data-debug | Enable debug mode |

API Reference

useUpdatedWidget Hook

Use this hook inside UpdatedWidgetProvider to control the widget from any component:

const { openLastReleaseNote, openReleaseNoteList, close } = useUpdatedWidget();

| Method | Description | |--------|-------------| | openLastReleaseNote() | Open the modal showing the latest release | | openReleaseNoteList() | Open the modal showing release history | | close() | Close the modal | | setOffset(offset) | Set widget position offset (desktop only) |

Vanilla JS API

| Method | Description | |--------|-------------| | UpdatedWidget.init(config) | Initialize the widget with configuration | | UpdatedWidget.open() | Open the latest release | | UpdatedWidget.openHistory() | Open the release history list | | UpdatedWidget.close() | Close the widget | | UpdatedWidget.destroy() | Remove widget and clean up | | UpdatedWidget.setOffset(offset) | Set widget position offset (desktop only) |

Global API (Script Tag)

window.UpdatedWidget.openLastReleaseNote();
window.UpdatedWidget.openReleaseNoteList();
window.UpdatedWidget.close();

User Identification

Track which users have seen releases:

// React with Provider
<UpdatedWidgetProvider
  clientKey="wk_xxx"
  userId={user.id}
  email={user.email}
  name={user.name}
>
  <MyComponent />
</UpdatedWidgetProvider>

// Vanilla JS
UpdatedWidget.init({
  clientKey: 'wk_xxx',
  userId: user.id,
  email: user.email,
  name: user.name,
});
  • With userId: Seen status is synced across devices
  • Without userId: Falls back to localStorage (device-specific)

Theming

// Auto-detect system preference
<UpdatedWidgetProvider theme="auto">

// Force light mode
<UpdatedWidgetProvider theme="light">

// Force dark mode
<UpdatedWidgetProvider theme="dark">

TypeScript

Full TypeScript support with exported types:

// React types
import type {
  UpdatedWidgetProps,
  UpdatedWidgetRef,
  UpdatedWidgetProviderProps,
  Release
} from '@updateddev/widget/react';

// Vanilla JS types
import type {
  UpdatedWidgetConfig,
  Release
} from '@updateddev/widget';

Error Handling

The widget provides helpful console messages for common issues:

| Error | Message | |-------|---------| | Missing clientKey | [UpdatedWidget] clientKey is required. | | Hook outside Provider | [UpdatedWidget] useUpdatedWidget must be used within an UpdatedWidgetProvider. | | Method called with no releases | [UpdatedWidget] openReleaseNoteList() called but no releases available. | | useMockData without debug | [UpdatedWidget] useMockData={true} is set but debug mode is disabled. |

Browser Support

  • Chrome / Edge 88+
  • Firefox 78+
  • Safari 14+

Debug Mode

Enable debug logging and mock data for development:

// React
<UpdatedWidgetProvider
  clientKey="wk_xxx"
  debug={true}
  useMockData={true}
>
  <MyComponent />
</UpdatedWidgetProvider>

// Vanilla JS
UpdatedWidget.init({
  clientKey: 'wk_xxx',
  debug: true,
  useMockData: true,
});

License

MIT - see LICENSE for details.