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

@agentictrust/ui

v0.1.2

Published

UI SDK and browser runtime for the Agentic Trust widget.

Readme

@agentictrust/ui

npm

Thin runtime loader and React SDK for the Agentic Trust chat widget.

v0.1.2+ — This package is a lightweight loader (~6 KB) that dynamically fetches widget.js from your platform URL at runtime. You always get the latest widget without updating the npm dependency. The apiUrl you pass must be reachable from the browser.

Install

npm install @agentictrust/ui

React / Next.js

"use client";

import { Widget } from "@agentictrust/ui";

export default function Page() {
  return (
    <div style={{ height: 720 }}>
      <Widget
        apiUrl="https://platform.agentictrust.com/api/v1"
        apiKey="lum_pk_your_api_key"
      />
    </div>
  );
}

On mount, the Widget component loads widget.js from your platform and renders the chat UI inside a shadow root, fully isolated from your app's styles.

Props

| Prop | Type | Required | Description | |------|------|----------|-------------| | apiUrl | string | Yes | API base URL (e.g. https://platform.agentictrust.com/api/v1) | | apiKey | string | Yes | Public API key (lum_pk_...) | | user | UserIdentity | No | End-user identity for HMAC verification | | userTokens | Record<string, string> | No | Auth headers forwarded to action endpoints | | pageContext | PageContext | No | Page metadata sent with messages | | captureDom | boolean | No | Auto-capture headings, links, buttons, and form fields | | readOnly | boolean | No | Hide the chat input | | className | string | No | CSS class on the host element | | style | CSSProperties | No | Inline styles on the host element |

Imperative client API

For non-React apps or floating widget installs:

import { initAsync, destroy } from "@agentictrust/ui";

await initAsync({
  apiUrl: "https://platform.agentictrust.com/api/v1",
  apiKey: "lum_pk_your_api_key",
});

// later
destroy();

Full API

| Method | Description | |--------|-------------| | init(options) | Mount the widget synchronously (uses default config) | | initAsync(options) | Mount the widget after fetching config from the server | | destroy() | Unmount the widget and clean up all state | | open() | Open the chat panel | | close() | Close the chat panel | | toggle() | Toggle the chat panel open/closed | | setContext(ctx) | Update page context for the next message | | registerTools(tools) | Register browser-side tools the agent can invoke | | onToolResult(callback) | Subscribe to server-side tool results (returns unsubscribe fn) | | registerToolRenderers(renderers) | Customize how specific tools render in the chat | | identify(token) | Verify user identity with a signed JWT | | setIdentityTokenFetcher(fn) | Auto-refresh JWT identity tokens before expiry |

Example: client-side tools + identity

import { initAsync, registerTools, identify, setContext } from "@agentictrust/ui";

await initAsync({
  apiUrl: "https://platform.agentictrust.com/api/v1",
  apiKey: "lum_pk_your_api_key",
});

registerTools({
  get_cart_items: async () => {
    const items = JSON.parse(localStorage.getItem("cart") ?? "[]");
    return { items, count: items.length };
  },
});

setContext({
  title: document.title,
  url: location.href,
});

await identify("<signed-jwt-token>");

Hosted script (IIFE)

Building this package also emits dist/agentic-trust-widget.js, an IIFE bundle that exposes a global AgenticTrust object. The main app copies it to /public/widget.js for script-tag embeds:

<script src="https://platform.agentictrust.com/widget.js"></script>
<script>
  AgenticTrust.initAsync({
    apiUrl: "https://platform.agentictrust.com/api/v1",
    apiKey: "lum_pk_your_api_key"
  });
</script>

Build

cd widget
npm run build

This produces:

  • dist/index.js + dist/index.d.ts — ES module thin loader for React bundlers (~6 KB)
  • dist/agentic-trust-widget.js — IIFE bundle for script-tag embeds (~365 KB, served by the platform)

Exports

// React component
import { Widget, AgenticTrustWidget } from "@agentictrust/ui";

// Imperative singleton
import { AgenticTrust } from "@agentictrust/ui";

// Individual methods
import { init, initAsync, destroy, open, close, toggle } from "@agentictrust/ui";
import { setContext, registerTools, onToolResult, registerToolRenderers } from "@agentictrust/ui";
import { identify, setIdentityTokenFetcher } from "@agentictrust/ui";

// Loader client (delegates to the platform's widget.js at runtime)
import { createAgenticTrust } from "@agentictrust/ui";

// Script loader (for manual control)
import { loadWidgetScript } from "@agentictrust/ui";

// Types
import type {
  InitOptions, WidgetConfig, PageContext, UserIdentity,
  ClientToolRegistryInput, ToolRendererMap, ToolResultEvent,
  AgenticTrustClient, AgenticTrustWidgetProps,
} from "@agentictrust/ui";

Publishing

The repo includes a GitHub Actions workflow at .github/workflows/publish-widget-sdk.yml. It publishes to npm when a widget-v* tag is pushed, provided the tagged commit includes changes under widget/.

Release flow

cd widget
npm version patch --no-git-tag-version
cd ..
git add widget/package.json
git commit -m "release: @agentictrust/ui $(node -p 'require(\"./widget/package.json\").version')"
git tag "widget-v$(node -p 'require(\"./widget/package.json\").version')"
git push origin master --tags

Requirements

  • GitHub repository secret NPM_TOKEN
  • npm access to publish under the @agentictrust scope