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

infaira-xp

v0.1.8

Published

InfAIra XP CLI — Widget development toolkit for the InfAIra Experience Portal

Readme

infaira-xp

CLI toolkit for building and publishing widgets for the InfAIra Experience Portal (IXP).


What is this?

infaira-xp is a command-line tool that helps widget developers:

  1. Scaffold a new widget project with all required files
  2. Upload a built widget bundle to an IXP portal

Installation

No installation needed. Use npx to always get the latest version:

npx infaira-xp <command>

Or install globally:

npm install -g infaira-xp
infaira-xp <command>

Commands

init — Scaffold a new widget

npx infaira-xp init <widget-name>

Example:

npx infaira-xp init my-sales-widget

What it does:

  • Creates a new folder my-sales-widget/
  • Fetches the latest ixp.d.ts type definitions from https://infaira.ai/dist/client/ixp.d.ts
  • Generates all files needed to build and run a widget

Files generated:

| File | Purpose | |------|---------| | bundle.json | Widget identity — unique ID, name, version | | src/index.tsx | Main widget React component | | src/ixp.ts | IXP bridge — registerWidget() and other registration functions | | src/styles.scss | Widget styles | | ixp.d.ts | TypeScript type definitions for IXP components | | designer.d.ts | TypeScript type definitions for the widget designer | | webpack.config.js | Build config — ensures React and IXP are NOT bundled | | tsconfig.json | TypeScript config | | package.json | npm dependencies | | index.html | Dev harness to preview the widget locally | | ui.html | UI harness for testing UIs | | localization.json | Localization strings | | .gitignore | Ignores node_modules/, dist/ |


upload — Upload a built widget to the portal

infaira-xp upload \
  --url <portal-url> \
  --token <auth-token> \
  --bundle <path-to-bundle.json> \
  --script <path-to-main.js>

Example:

infaira-xp upload \
  --url https://infaira.ai \
  --token eyJhbGciOiJIUzI1NiJ9... \
  --bundle ./bundle.json \
  --script ./dist/main.js

Options:

| Flag | Required | Description | |------|----------|-------------| | --url | Yes | Base URL of the IXP portal | | --token | Yes | Your JWT auth token from the portal | | --bundle | Yes | Path to bundle.json | | --script | Yes | Path to compiled main.js (from npm run build) |

What it does:

  • Sends bundle.json and main.js to the portal's /api/bundles/upload endpoint
  • The portal stores widget metadata in the database
  • The widget becomes available in the portal's widget library
  • Admins can then add it to any dashboard

Full Developer Workflow

# 1. Scaffold a new widget
npx infaira-xp init my-widget

# 2. Install dependencies
cd my-widget
npm install

# 3. Start dev server (preview at http://localhost:8080)
npm run dev

# 4. Build for production
npm run build

# 5. Upload to the IXP portal
infaira-xp upload \
  --url https://infaira.ai \
  --token <your-token> \
  --bundle ./bundle.json \
  --script ./dist/main.js

Widget Structure

Every widget scaffolded by infaira-xp init follows this structure:

my-widget/
├── bundle.json          ← Widget metadata (edit this to configure your widget)
├── localization.json    ← Localization strings
├── src/
│   ├── index.tsx        ← Your widget component (main file to edit)
│   ├── ixp.ts           ← IXP bridge (do not edit)
│   └── styles.scss      ← Widget styles
├── resources/
│   ├── ixp-components.js   ← IXP component library (for dev mode)
│   ├── infaira-logo.png
│   └── infaira-icon.png
├── ixp.d.ts             ← IXP type definitions
├── designer.d.ts        ← Designer type definitions
├── index.html           ← Dev harness
├── ui.html              ← UI harness
├── webpack.config.js    ← Build config
├── tsconfig.json
└── package.json

How Widgets Work

Developer builds → main.js + bundle.json
        ↓
Upload via infaira-xp upload
        ↓
Portal stores main.js + metadata in DB
        ↓
Portal loads main.js as <script> tag at runtime
        ↓
Script calls window.registerWidget() → widget appears in grid
        ↓
Widget receives ixpContext → calls executeAction() → renders data

bundle.json Reference

{
  "id": "your-bundle-uuid",
  "name": "My Widget",
  "version": "1.0.0",
  "author": "Your Name",
  "widgets": [
    {
      "id": "my-widget",
      "name": "My Widget",
      "description": "What this widget does",
      "icon": "",
      "tags": [],
      "category": "",
      "isTemplate": false
    }
  ],
  "sidebarLinks": [],
  "uis": [],
  "menuItems": []
}

Using ixpContext in your widget

The portal passes an ixpContext prop to every widget. Use it to fetch data from Orch:

const MyWidget: React.FC<IWidgetProps> = ({ ixpContext }) => {
  const [data, setData] = React.useState(null);

  React.useEffect(() => {
    if (!ixpContext) return;

    ixpContext
      .executeAction('MyModel', 'GetAll', {}, { json: true })
      .then((result) => setData(result));
  }, [ixpContext]);

  return <div>{JSON.stringify(data)}</div>;
};

Important Rules

  • Never bundle React — it comes from the portal at runtime. The webpack.config.js externals handle this automatically.
  • Always call registerWidget() at the bottom of src/index.tsx — this is how the portal discovers your widget.
  • Widget ID must match bundle.json — the ID you pass to registerWidget() must exist in the widgets array in bundle.json.
  • Grid is 30 columns — design your widget layout accordingly.

Updating ixp.d.ts

The type definitions are served from https://infaira.ai/dist/client/ixp.d.ts. When you run npx infaira-xp init, it always fetches the latest version. If the server is unreachable, it falls back to the version bundled inside the npm package.


Publishing a New CLI Version (Maintainers Only)

# Make your changes in src/ or templates/
# then bump version and publish:

npm version patch   # bug fix  → 0.1.1
npm version minor   # new feature → 0.2.0
npm version major   # breaking change → 1.0.0

npm publish --access public

Requirements

  • Node.js >= 18
  • npm >= 7