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

ape-im-sdk-react

v1.0.5

Published

React SDK for Ape Instant Messenger - Add nostalgic AOL-style chat to your ApeChain dApp

Readme

ape-im-sdk-react

React SDK for Ape Instant Messenger - Add nostalgic AOL-style chat functionality to your ApeChain dApp with a single line of code.

Features

  • 💬 Popup Chat Widget - Floating chat bubble with full messenger interface
  • 🔐 Wallet Authentication - Connect via MetaMask, WalletConnect, or any injected wallet
  • 🎨 Retro AIM Aesthetic - Classic 90s AOL Instant Messenger design
  • 🖼️ NFT Profile Pictures - Use your ApeChain NFTs as avatars
  • 💰 Crypto Tipping - Send APE tokens directly in chat
  • 🔒 Token-Gated Chats - Create exclusive group chats for token holders
  • 📱 Real-time Messaging - WebSocket-powered instant delivery
  • 🎭 Rich Content - Emoji reactions, GIFs, stickers, voice messages
  • 🌙 Dark Mode - Full light/dark theme support

Installation

npm install ape-im-sdk-react
# or
yarn add ape-im-sdk-react
# or
pnpm add ape-im-sdk-react

Requirements

  • React 18+
  • Glyph Wallet - Ape IM requires Glyph for wallet authentication
  • Ape IM API endpoint (defaults to https://www.apeinstantmessenger.com)

Quick Start

Add the chat widget to your app with just a few lines:

import { ApeIMProvider, ChatWidget } from 'ape-im-sdk-react';
import 'ape-im-sdk-react/styles.css';

function App() {
  return (
    <ApeIMProvider>
      <YourApp />
      <ChatWidget position="bottom-right" />
    </ApeIMProvider>
  );
}

That's it! Your users can now click the floating chat bubble to open the messenger.

Next.js / SSR Support

The ChatWidget component is fully SSR-compatible and will only render on the client. For Next.js apps, you can use it directly:

// pages/_app.tsx or app/layout.tsx
import { ApeIMProvider, ChatWidget } from 'ape-im-sdk-react';
import 'ape-im-sdk-react/styles.css';

function MyApp({ Component, pageProps }) {
  return (
    <ApeIMProvider>
      <Component {...pageProps} />
      <ChatWidget position="bottom-right" />
    </ApeIMProvider>
  );
}

The widget automatically handles server-side rendering by returning null during SSR and hydrating properly on the client.

Configuration

ApeIMProvider Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | apiUrl | string | https://www.apeinstantmessenger.com | API endpoint | | theme | 'light' \| 'dark' \| 'system' | 'system' | Color theme | | onConnect | (user: User) => void | - | Callback when user connects | | onDisconnect | () => void | - | Callback when user disconnects |

ChatWidget Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | position | 'bottom-right' \| 'bottom-left' | 'bottom-right' | Widget position | | offset | { x: number, y: number } | { x: 20, y: 20 } | Offset from corner | | defaultOpen | boolean | false | Start with widget open | | bubbleSize | number | 60 | Size of the chat bubble | | zIndex | number | 9999 | CSS z-index |

Hooks

useApeIM

Access authentication state and methods:

import { useApeIM } from 'ape-im-sdk-react';

function MyComponent() {
  const { 
    user,           // Current user object
    isConnected,    // Boolean connection state
    isLoading,      // Loading state
    connect,        // Connect wallet function
    disconnect,     // Disconnect function
    openWidget,     // Open the chat widget
    closeWidget,    // Close the chat widget
  } = useApeIM();

  return (
    <button onClick={connect}>
      {isConnected ? user.username : 'Connect'}
    </button>
  );
}

useConversations

Access user's conversations:

import { useConversations } from 'ape-im-sdk-react';

function ConversationList() {
  const { 
    conversations,  // Array of conversations
    isLoading,
    startConversation,  // Start new DM
    createGroup,        // Create group chat
  } = useConversations();

  return (
    <ul>
      {conversations.map(conv => (
        <li key={conv.id}>{conv.name}</li>
      ))}
    </ul>
  );
}

useChat

Access chat functionality for a specific conversation:

import { useChat } from 'ape-im-sdk-react';

function ChatRoom({ conversationId }) {
  const {
    messages,
    sendMessage,
    isTyping,
    participants,
  } = useChat(conversationId);

  return (
    <div>
      {messages.map(msg => (
        <div key={msg.id}>{msg.content}</div>
      ))}
    </div>
  );
}

Styling

The SDK includes default retro AIM styling. Import the CSS:

import 'ape-im-sdk-react/styles.css';

Custom Theming

Override CSS variables to customize:

:root {
  --ape-im-primary: #1D3FE7;
  --ape-im-primary-dark: #142B99;
  --ape-im-accent: #E8EDFF;
  --ape-im-bubble-user: #1D3FE7;
  --ape-im-bubble-other: #e5e5e5;
}

TypeScript

Full TypeScript support with exported types:

import type { 
  User, 
  Message, 
  Conversation,
  ChatWidgetProps,
  ApeIMProviderProps,
} from 'ape-im-sdk-react';

API Documentation

For complete API documentation, visit: https://www.apeinstantmessenger.com/docs

Publishing to npm

To publish the SDK to npm:

# Navigate to the SDK package
cd packages/sdk-react

# Install dependencies
npm install

# Build the package
npm run build

# Login to npm (if not already)
npm login

# Publish to npm
npm publish --access public

Versioning

Before publishing a new version, update the version in package.json:

# Patch release (1.0.0 -> 1.0.1)
npm version patch

# Minor release (1.0.0 -> 1.1.0)
npm version minor

# Major release (1.0.0 -> 2.0.0)
npm version major

Development

# Install dependencies
npm install

# Build with watch mode for development
npm run dev

# Build for production
npm run build

License

MIT © Ape IM Team