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

@smonier/page-insights

v1.0.0

Published

Jahia Page Insights Module

Downloads

95

Readme

Page Insights Module

Page Insights is a Jahia module that adds an insights widget to the JContent page header. It queries jExperience/Unomi through the built-in proxy to show visit metrics and a time-series chart for the current page.

Features

  • Summary metrics: all visits, visits in range, unique sessions, unique visitors, direct entries
  • Time range selector (today, last week, last month, last 3/6 months)
  • Time-series chart of page views
  • Refresh action with caching to avoid repeated calls
  • Optional link to the jExperience dashboard when the dashboards module is installed

Screenshot

picture

Requirements

  • Jahia with the jexperience module installed
  • Site must have jexperience and page-insights installed
  • Optional: jexperience-dashboards to enable the dashboard button

Getting Started

This module ships with a Docker-based development environment.

# Install dependencies
yarn install

# Start Jahia in Docker
docker compose up --wait

# Start the dev mode (watch build)
yarn dev

The watcher rebuilds the module whenever source files change.

Commands

Run scripts with yarn <script>:

| Category | Script | Description | | ------------ | --------------------- | ----------------------------------------------------------------------- | | Build | build | Produces a deployable artifact that can be uploaded to a Jahia instance | | Build | deploy | Pushes the build artifact to a Jahia instance | | Development | dev (alias watch) | Watches for changes and rebuilds the module | | Code quality | format | Runs Prettier (a code formatter) on your code | | Code quality | lint | Runs ESLint (a linter) on your code | | Utils | clean | Removes build artifacts | | Utils | package | Packs distributions files in a .tgz archive inside the dist/ folder | | Utils | watch:callback | Called every time a build succeeds in watch mode |

Usage

  • Open JContent and navigate to a page.
  • The Page Insights header appears for jnt:page nodes when the module is installed.
  • Click the header to expand/collapse the insights content.

Configuration

The module reads configuration from window.contextJsParameters:

  • contextJsParameters.config.pageInsights.unomiBaseUrl: base URL for the Unomi proxy. If unset, the current origin is used.
  • contextJsParameters.siteKey (or contextJsParameters.site.key): site key for the proxy path.

If your Unomi proxy is not on the same origin, inject unomiBaseUrl via your Jahia configuration so the UI can reach /modules/jexperience/proxy/<siteKey> on the correct host.

Data Source

The UI calls the jExperience proxy endpoints to fetch:

  • Total page views (all time)
  • Page views in the selected time range (daily aggregation)
  • Direct entries
  • Unique sessions and visitors

Requests are executed via /modules/jexperience/proxy/<siteKey> and cached per page/range in the browser to reduce round-trips.

Localization

Translations live in settings/locales/ under the page-insights namespace. Add or update keys there to localize the UI.

Project Structure

  • src/pageInsightsBlock.tsx: page header UI and chart rendering
  • src/unomiInsightsService.js: Unomi proxy calls, caching, and normalization
  • src/init.tsx: UI extender registration
  • settings/locales/: i18n resources

Deployment

To deploy to a Jahia instance, ensure .env has valid credentials and host, then run:

yarn build
yarn deploy

You can edit .env to match your environment (defaults are provided).

Troubleshooting

  • No widget appears: verify the jexperience module and page-insights are installed on the site.
  • Errors in the widget: check the Unomi proxy availability and response status. If your proxy requires auth, add headers in src/unomiInsightsService.js.