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

experience-card-utils

v1.0.0

Published

Common ReactJS utility functions for Experience Card development

Readme

Experience Card Utils

A collection of common ReactJS utility functions, hooks, and components for Experience Card development.

Installation

npm install experience-card-utils

Features

  • 🎣 Custom Hooks: Reusable React hooks for common patterns
  • 🛠️ Utility Functions: Helper functions for everyday tasks
  • 🎨 Components: Pre-built React components for Experience Cards
  • 🔌 Experience API: Functions for Ellucian Experience API integration

Usage

Experience API Functions

ExecuteServerlessAPI

Call Ellucian Integrate APIs with OAuth authentication:

import { ExecuteServerlessAPI } from 'experience-card-utils';

const response = await ExecuteServerlessAPI({
  pipelineApiName: 'xcgslist-update',
  cardId: 'A20136987',
  userInfo: { tenantAlias: 'your-tenant' },
  dataJsonString: JSON.stringify({ key: 'value' }),
  method: 'POST'
});

const result = JSON.parse(response);
console.log(result.data);

ExecuteServerlessAPIBatch

Process multiple items with concurrent batch processing:

import { ExecuteServerlessAPIBatch } from 'experience-card-utils';

const responses = await ExecuteServerlessAPIBatch({
  dataArray: [{ id: 1 }, { id: 2 }, { id: 3 }],
  pipelineApiName: 'xcgslist-update',
  cardId: 'A20136987',
  userInfo: { tenantAlias: 'your-tenant' },
  concurrentThreads: 3,
  onProgress: (results) => {
    console.log(`Progress: ${results.length} items processed`);
  }
});

fetchOauth

Get OAuth token from Experience API:

import { fetchOauth } from 'experience-card-utils';

const token = await fetchOauth({
  userInfo: { tenantAlias: 'your-tenant' }
});

Hooks

useDebounce

Debounce a value to optimize performance:

import { useDebounce } from 'experience-card-utils';

function SearchComponent() {
  const [searchTerm, setSearchTerm] = useState('');
  const debouncedSearch = useDebounce(searchTerm, 500);

  // Use debouncedSearch for API calls
}

useLocalStorage

Persist state in localStorage:

import { useLocalStorage } from 'experience-card-utils';

function App() {
  const [name, setName] = useLocalStorage('username', 'Guest');
  // State automatically syncs with localStorage
}

Utilities

classNames

Conditionally combine CSS classes:

import { classNames } from 'experience-card-utils';

const buttonClass = classNames(
  'btn',
  { 'btn-active': isActive },
  disabled && 'btn-disabled'
);

formatDate

Format dates consistently:

import { formatDate } from 'experience-card-utils';

const formatted = formatDate(new Date(), { 
  year: 'numeric', 
  month: 'short', 
  day: 'numeric' 
});

Components

Card

A reusable card component:

import { Card } from 'experience-card-utils';

function App() {
  return (
    <Card title="My Card" onClick={() => console.log('Clicked!')}>
      <p>Card content goes here</p>
    </Card>
  );
}

Development

Build

npm run build

Watch Mode

npm run dev

Type Check

npm run type-check

Lint

npm run lint

Testing Locally Before Publishing

Option 1: Using npm link (Recommended for Development)

  1. In this library project:
npm run build
npm link
  1. In your Experience Card project:
npm link experience-card-utils
  1. Import and use:
import { ExecuteServerlessAPI, useDebounce } from '@experience/card-utils';
  1. To unlink later:
# In your Experience Card project
npm unlink experience-card-utils

# In this library project
npm unlink

Option 2: Using npm pack (Test Production Build)

  1. Build and create tarball:
npm run build
npm pack

This creates a file like experience-card-utils-1.0.0.tgz

  1. In your Experience Card project, install the local package:
npm install /path/to/plugins/experience-card-utils-1.0.0.tgz
  1. Import and use normally:
import { ExecuteServerlessAPI } from '@experience/card-utils';

Publishing to npm

First Time Setup

  1. Create an npm account at https://www.npmjs.com/signup

  2. Login via terminal:

npm login

Publishing Steps

  1. Update version in package.json (follow semantic versioning):
{
  "version": "1.0.1"  // or 1.1.0, 2.0.0, etc.
}
  1. Build and publish:
npm run build
npm publish

The package is configured for public access on npmjs.

Version Updates

  • Patch (1.0.0 → 1.0.1): Bug fixes

    npm version patch
    npm publish
  • Minor (1.0.0 → 1.1.0): New features, backward compatible

    npm version minor
    npm publish
  • Major (1.0.0 → 2.0.0): Breaking changes

    npm version major
    npm publish

Using in Experience Card Projects

Installation

npm install @experience/card-utils

TypeScript Support

The package includes TypeScript definitions automatically. No additional @types package needed.

Import Examples

// Import specific functions
import { ExecuteServerlessAPI, useDebounce, Card } from 'experience-card-utils';

// Or import types
import type { ExecuteServerlessAPIParams } from 'experience-card-utils';

React Peer Dependencies

This library requires React 16.8+ (hooks support). Make sure your Experience Card project has:

  • react ^16.8.0 || ^17.0.0 || ^18.0.0
  • react-dom ^16.8.0 || ^17.0.0 || ^18.0.0

Package Details

  • Package Name: experience-card-utils
  • Formats: ESM and CommonJS
  • TypeScript: Full type definitions included
  • Tree-shakeable: Import only what you need
  • Side-effect free: Safe for bundler optimization

License

MIT