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

@accurix/centrinfo

v0.4.0

Published

Modular Centrinfo customer experience SDK for chat and governed analytics.

Readme

@accurix/centrinfo

One modular SDK for Centrinfo chat and governed customer analytics. Import only the feature entry points used by the host application.

pnpm add @accurix/centrinfo
import { createCentrinfo } from '@accurix/centrinfo';
import { chat } from '@accurix/centrinfo/chat';
import { liveboards } from '@accurix/centrinfo/liveboards';

const centrinfo = createCentrinfo({
  publicWidgetToken: 'pub_...',
  applicationId: '...',
  theme: {
    accent: '#2563eb',
    background: '#f8fafc',
    surface: '#ffffff',
    text: '#101827',
    border: '#dbe4ee',
    radius: '16px',
    fontFamily: 'Avenir Next, sans-serif',
  },
  getIdentityToken: async () => {
    const response = await fetch('/api/centrinfo/token', {
      credentials: 'include',
    });
    if (!response.ok) throw new Error('Sign in is required.');
    return response.json();
  },
  features: [chat(), liveboards()],
});

await centrinfo.chat.mountFloating();
centrinfo.liveboards.mount('#customer-dashboard', {
  liveboardId: '...',
});

// Or switch between every Liveboard assigned to this SDK application.
centrinfo.liveboards.mountCollection('#customer-dashboards', {
  navigation: 'tabs',
});

For a full-page conversation:

await centrinfo.chat.mountFullPage('#support', {
  persistence: 'session',
  sidebar: 'collapsed',
  userLabel: 'Alex Kim',
  userDetail: '[email protected]',
  userAvatarUrl: 'https://customer-app.example/alex.png',
  assistantAvatarUrl: 'https://customer-app.example/assistant.png',
  attachments: true,
});

Full-page chat is a separate AI workspace UI from the floating messenger. Its conversation rail defaults to collapsed, so it can sit beside the host application's own sidebar. The returned handle can control it:

const chatApp = await centrinfo.chat.mountFullPage('#support');

chatApp.expandSidebar();
chatApp.collapseSidebar();
chatApp.hideSidebar();

Styling and branding

Pass theme to createCentrinfo when chat and Liveboards should inherit the same customer-portal look. The SDK uses Shadow DOM isolation for embedded surfaces, so host CSS should not be required for normal styling.

const centrinfo = createCentrinfo({
  publicWidgetToken: 'pub_...',
  applicationId: '...',
  getIdentityToken,
  features: [chat(), liveboards()],
  theme: {
    accent: '#2563eb',
    accentStrong: '#1d4ed8',
    accentSoft: 'rgba(37, 99, 235, 0.1)',
    background: '#f8fafc',
    surface: '#ffffff',
    surfaceMuted: '#f1f5f9',
    text: '#101827',
    mutedText: '#52647a',
    subtleText: '#7a8da3',
    border: '#dbe4ee',
    radius: '16px',
    fontFamily: 'Avenir Next, sans-serif',
  },
});

Full-page chat also accepts customer-session presentation fields:

await centrinfo.chat.mountFullPage('#support', {
  sidebar: 'collapsed',
  header: true,
  userLabel: currentUser.name,
  userDetail: currentUser.email,
  userAvatarUrl: currentUser.avatarUrl,
  assistantAvatarUrl: '/brand/assistant-avatar.png',
  attachments: true,
});

attachments: true allows image, PDF, text, and CSV attachments where the configured application and backend permit extraction. The assistant avatar can also come from the SDK application settings in Centrinfo; the explicit assistantAvatarUrl option is only a host-side fallback.

Liveboard collection navigation shows only the assigned Liveboards by default. Pass navigationLabel only when the host application wants an extra visible label above those tabs.

The host backend must create short-lived identity tokens. Private signing keys must never be shipped to the browser.

import { signCentrinfoIdentityToken } from '@accurix/centrinfo/server';

const token = await signCentrinfoIdentityToken({
  privateKeyPem: process.env.CENTRINFO_SIGNING_PRIVATE_KEY!,
  applicationId: '...',
  subject: session.user.id,
  accountId: session.user.accountId,
  context: {
    businessId: session.user.businessId,
  },
  expiresInSeconds: 600,
});

Chat history and logout

Use the same stable externalUserId every time a customer signs in. Centrinfo uses that verified identity to restore retained floating-chat and full-page-chat conversations from the backend, including in another browser or device.

Anonymous chat history is browser-local. It is never returned as another user's authenticated history.

Call the unified runtime logout method when the host application signs out:

centrinfo.logout();

This unmounts authenticated chat surfaces and clears the active identity from the SDK. The user's server-side history remains available for their next verified sign-in. Use a chat handle's shutdown() only when you also need to erase that surface's local cache, such as on a shared or kiosk device.

History remains subject to the widget token's configured retention period and message limit. A different externalUserId creates a separate history scope.