How to add a what's new widget to your app

By Hasan · November 5, 2026 · 5 min read

A what's new widget is a small panel inside your app that shows your latest changelog entries. With JustOneCX you add the attribute data-justonecx-whats-new to any button. The SDK opens the panel when the visitor clicks it and adds a badge when there are unread entries. You turn it on in the Publish tab of Roadmap & Changelog.

What is a what's new widget for?

Customers rarely visit a changelog page on their own. A panel inside the product puts new entries where they already work. The badge shows that something is new, and clicking the button opens the entries.

The panel shows your changelog, or your roadmap. If you have not written entries yet, read how to write a changelog first.

How do you turn it on?

  1. Open Roadmap & Changelog > Publish > On your website.
  2. Switch On your website on. The widget needs it.
  3. Pick how customers open the panel: from your own button or from a floating button we add.
  4. Call init() once in your app, before the widget is used.

If you have not installed the SDK yet, the quickstart in the docs shows how to connect.

How do you open it from your own button?

Add one attribute to a button. No JavaScript is needed.

<button data-justonecx-whats-new>What's new</button>
<button data-justonecx-roadmap>Roadmap</button>

The attribute works on any element, including ones your framework renders later. The first button opens the changelog. The second opens the roadmap.

What does the unread badge do?

The SDK sets data-justonecx-unread="3" on the button when there are unread entries, and adds a badge. The number is the count of unread entries. You can style the button yourself with that attribute.

For example, a CSS rule can target [data-justonecx-unread] to change the button colour when something is new.

An entry is unread when it was published after the visitor last opened the panel. Identified visitors keep that state across devices. For how identity works, see identify users with the SDK.

Which functions can you call from code?

If you prefer code to attributes, the SDK exports functions.

import { openChangelog, openRoadmap, getUnreadChangelogCount, onUnreadChangelogCountChange } from "@justonecx/sdk";

openChangelog();
const unread = getUnreadChangelogCount();
const stop = onUnreadChangelogCountChange((count) => setBadge(count));
  • openChangelog() opens the panel on the changelog.
  • openRoadmap() opens it on the roadmap.
  • getUnreadChangelogCount() returns the number of unread entries.
  • onUnreadChangelogCountChange(callback) calls your function when the count changes, and returns a function to stop listening.

If you use the script tag, call window.JustOneCX.openChangelog() and the other functions from the window.JustOneCX object.

Use the callback when you draw your own badge, for example a number in a menu item built with your design system.

What should you put in the panel?

The panel shows what you publish in the Changelog tab. Short entries with a clear title work best in a small panel. Nothing reaches the changelog until you publish it. When you mark an idea Shipped, a changelog draft is created. You edit it and publish. Optionally, publishing also shows a banner in your product that links to the entry.

For the difference between a banner message and a permanent entry, read the announcement vs changelog article.

How do you style the button and badge?

The widget does not force a look on your button. You own the button, so it matches your design. The one hook the SDK gives you is the data-justonecx-unread attribute. When there are unread entries it holds the count, and when there are none it is not shown. Use it in a CSS selector to change colour, add a dot or hide a label.

If you draw your own badge, read the count with getUnreadChangelogCount() for the first render. Then keep it current with onUnreadChangelogCountChange. The callback returns a function. Call that function when your component unmounts, so you do not leave a listener behind.

Does it work in a single-page app?

The attribute works on elements your framework renders later, so a button that appears after navigation still works. If your tours and announcements do not change when the route changes, pass trackRouteChanges: true to init() or add data-track-route-changes="true" on the script tag.

What should you check before you ship it?

Click the button in a private window, so you see the panel the way a new visitor does. Publish one test entry and confirm the badge count goes up. Open the panel and confirm the count goes down. If you use an identified visitor, check that the state follows the person to a second browser.

Where else can customers see the changelog?

The same entries also appear on a hosted page, on your own subdomain and in embedded boards. See the Roadmap, ideas and changelog guide and the What's new widget docs.

Frequently asked questions

Do I need to write JavaScript to open the panel?

No. Add data-justonecx-whats-new to any button. The SDK does the rest.

How do I show an unread count?

The SDK sets data-justonecx-unread on the button and adds a badge. You can also call getUnreadChangelogCount() or listen with onUnreadChangelogCountChange.

What counts as unread?

An entry is unread when it was published after the visitor last opened the panel. Identified visitors keep that state across devices.

Why does nothing happen when I click the button?

Check that On your website is switched on in the Publish tab, and that init() ran. The browser console logs problems with the prefix [JustOneCX].

See how it works in the live demo.

See it working in 2 minutes

Try the live demo

Related