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

@appswave/react-sdk

v1.0.2

Published

A reusable React SDK containing hooks and utilities for AppsWave projects

Downloads

17

Readme

@appswave/react-sdk

A reusable React SDK containing hooks and utilities for AppsWave projects.

Installation

npm install @appswave/react-sdk
# or
yarn add @appswave/react-sdk
# or
pnpm add @appswave/react-sdk

Peer Dependencies

This package requires React 18+ or 19+. Some hooks require additional peer dependencies:

Required

  • react ^18.0.0 || ^19.0.0
  • react-dom ^18.0.0 || ^19.0.0

Optional (for specific hooks)

  • @tanstack/react-query ^5.0.0 - Required for React Query hooks
  • @tanstack/react-table ^8.0.0 - Required for data table hooks
  • nuqs ^2.0.0 - Required for URL state management hooks
  • zod ^3.0.0 - Required for validation utilities
  • html-to-image ^1.0.0 - Required for PDF utilities
  • jspdf ^3.0.0 - Required for PDF utilities
  • clsx ^2.0.0 - Required for Tailwind utilities
  • tailwind-merge ^2.0.0 - Required for Tailwind utilities

Usage

Import Hooks

import { useDebounce, useClipboard, useStorage } from '@appswave/react-sdk';

Import Utilities

import { cn, persistData, getPersistentData } from '@appswave/react-sdk';

Import Types

import type { ExtendedSortingState, ResultDto } from '@appswave/react-sdk';

Hooks

Shared Hooks

useDebounce

Debounces a value, returning the latest value after a delay.

import { useDebounce } from '@appswave/react-sdk';

function MyComponent() {
  const [search, setSearch] = useState('');
  const debouncedSearch = useDebounce(search, 500);
  
  useEffect(() => {
    // Perform search with debouncedSearch
  }, [debouncedSearch]);
}

useClipboard

Hook for copying text to clipboard.

import { useClipboard } from '@appswave/react-sdk';

function MyComponent() {
  const { copied, copy } = useClipboard({
    timeout: 2000,
    onSuccess: () => console.log('Copied!'),
  });
  
  return (
    <button onClick={() => copy('Hello World')}>
      {copied ? 'Copied!' : 'Copy'}
    </button>
  );
}

useStorage

Hook for managing localStorage.

import { useStorage } from '@appswave/react-sdk';

function MyComponent() {
  const [value, setValue] = useStorage<string>('my-key', 'default');
  
  return (
    <input
      value={value}
      onChange={(e) => setValue(e.target.value)}
    />
  );
}

useMediaQuery

Hook for responsive breakpoint detection.

import { useMediaQuery } from '@appswave/react-sdk';

function MyComponent() {
  const { matchDownMD, matchUpLG, recalc } = useMediaQuery();
  
  return (
    <div>
      {matchDownMD && <p>Mobile view</p>}
      {matchUpLG && <p>Desktop view</p>}
    </div>
  );
}

useInfiniteScroll

Hook for infinite scroll functionality.

import { useInfiniteScroll } from '@appswave/react-sdk';

function MyComponent() {
  const loadMoreRef = useInfiniteScroll({
    onLoadMore: () => fetchMore(),
    hasMore: hasMore,
    isLoading: isLoading,
  });
  
  return <div ref={loadMoreRef}>Loading...</div>;
}

usePageVisibility

Hook to track page/tab visibility.

import { usePageVisibility } from '@appswave/react-sdk';

function MyComponent() {
  const { isTabActive } = usePageVisibility();
  
  return <div>{isTabActive ? 'Tab is active' : 'Tab is inactive'}</div>;
}

useShortcuts

Hook for keyboard shortcuts.

import { useShortcuts } from '@appswave/react-sdk';

function MyComponent() {
  useShortcuts({
    'ctrl+s': () => save(),
    'ctrl+z': () => undo(),
  });
}

Utility Hooks

useIsFetchingQuery

Hook to check if a React Query is currently fetching.

import { useIsFetchingQuery } from '@appswave/react-sdk';

function MyComponent() {
  const { isLoading } = useIsFetchingQuery('users');
  
  return isLoading ? <Spinner /> : <Content />;
}

useIsLoadingMutation

Hook to check if a React Query mutation is currently loading.

import { useIsLoadingMutation } from '@appswave/react-sdk';

function MyComponent() {
  const { isLoading } = useIsLoadingMutation('createUser');
  
  return (
    <button disabled={isLoading}>
      {isLoading ? 'Creating...' : 'Create User'}
    </button>
  );
}

Utilities

Tailwind Utilities

cn

Merge Tailwind CSS classes.

import { cn } from '@appswave/react-sdk';

<div className={cn('base-class', condition && 'conditional-class')} />

Storage Utilities

persistData

Persist data to localStorage.

import { persistData } from '@appswave/react-sdk';

persistData('key', { name: 'John' });

getPersistentData

Get persistent data from localStorage.

import { getPersistentData } from '@appswave/react-sdk';

const data = getPersistentData<{ name: string }>('key', { name: 'Default' });

API Utilities

pathBuilder

Build a path with parameters.

import { pathBuilder } from '@appswave/react-sdk';

const path = pathBuilder({
  path: '/users/:id/posts/:postId',
  pathParams: { id: 1, postId: 2 },
  queryParams: 'sort=desc',
});
// Returns: '/users/1/posts/2?sort=desc'

constructPlainRoutes

Construct plain routes from nested route objects.

import { constructPlainRoutes } from '@appswave/react-sdk';

const routes = {
  users: {
    list: '/users',
    detail: '/users/:id',
  },
};

const plainRoutes = constructPlainRoutes(routes);
// Returns: { users: { list: '/users', detail: '/users' } }

Media Utilities

downloadBlob

Download a blob as a file.

import { downloadBlob } from '@appswave/react-sdk';

const blob = new Blob(['content'], { type: 'text/plain' });
await downloadBlob(blob, 'file.txt');

Tree Shaking

This package supports tree-shaking. You can import specific hooks or utilities:

// ✅ Good - tree-shakeable
import { useDebounce } from '@appswave/react-sdk';

// ✅ Also good - tree-shakeable
import { useDebounce } from '@appswave/react-sdk/hooks';

// ❌ Avoid - imports everything
import * as SDK from '@appswave/react-sdk';

TypeScript

This package is written in TypeScript and includes type definitions. All exports are fully typed.

License

MIT

Contributing

Contributions are welcome! Please open an issue or submit a pull request.