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

@ragrabbit/search-react

v0.1.1

Published

RagRabbit React SDK

Readme

RagRabbit Search React

A React component library for integrating RagRabbit search and chat functionality into your application.

Installation

npm install @ragrabbit/search-react
# or
yarn add @ragrabbit/search-react
# or
pnpm add @ragrabbit/search-react

Components

RagRabbitModal

A standalone modal component that displays an iframe with the RagRabbit chat widget.

import { RagRabbitModal } from "@ragrabbit/search-react";

function MyComponent() {
  const [isOpen, setIsOpen] = useState(false);

  return (
    <RagRabbitModal
      open={isOpen}
      onOpenChange={setIsOpen}
      domain="https://your-domain.com/" // Required, the domain where your RagRabbit instance is hosted
      position="centered" // Optional, "centered" or "right", defaults to "centered"
    />
  );
}

RagRabbitChatButton

A floating button that opens a chat modal when clicked.

import { RagRabbitChatButton } from "@ragrabbit/search-react";

function MyComponent() {
  return (
    <RagRabbitChatButton
      buttonText="Chat" // Optional, defaults to "Chat"
      domain="https://your-domain.com/" // Required, the domain where your RagRabbit instance is hosted
    />
  );
}

RagRabbitSearchInput

A search input that opens the chat modal when focused or clicked.

import { RagRabbitSearchInput } from "@ragrabbit/search-react";

function MyComponent() {
  return (
    <RagRabbitSearchInput
      placeholder="Search..." // Optional, defaults to "Search..."
      domain="https://your-domain.com/" // Required, the domain where your RagRabbit instance is hosted
    />
  );
}

License

MIT

RagRabbit API Client

A TypeScript client for interacting with the RagRabbit API. This client provides type-safe methods for adding and processing content in your RagRabbit instance.

Installation

npm install @repo/search-react
# or
yarn add @repo/search-react
# or
pnpm add @repo/search-react

Usage

Creating a Client Instance

import { RagRabbitAPI } from "@repo/search-react";

const client = RagRabbitAPI.create("https://your-ragrabbit-instance.com", "your-api-key");

Adding Content

Add URLs or content to be indexed:

// Add a URL for crawling
await client.addContent({
  url: "https://example.com",
  doCrawl: true,
});

// Add specific content for a URL
await client.addContent({
  url: "https://example.com/article",
  content: "Your content here...",
  doCrawl: false,
});

Processing Content

Trigger the processing/indexing of content. This is particularly useful in CI/CD pipelines when you want to ensure your content is indexed after deployment.

// Process all pending content
await client.runProcessing();

// Process a specific URL
await client.runProcessing({
  url: "https://example.com",
});

CI/CD Integration Example

Here's an example of how to integrate content processing in your CI/CD pipeline:

# GitHub Actions example
name: Index Content

on:
  deployment_status:
    states: [success]

jobs:
  index-content:
    runs-on: ubuntu-latest
    if: github.event.deployment_status.state == 'success'
    steps:
      - name: Trigger Content Indexing
        uses: actions/github-script@v6
        with:
          script: |
            const { RagRabbitAPI } = require("@ragrabbit/search-react");

            const client = RagRabbitAPI.create(
              process.env.RAGRABBIT_API_URL,
              process.env.RAGRABBIT_API_KEY
            );

            // Start processing all pending content
            await client.runProcessing();

Error Handling

The client includes built-in error handling with detailed error messages:

try {
  await client.addContent({
    url: "https://example.com",
    doCrawl: true,
  });
} catch (error) {
  if (error instanceof APIError) {
    console.error(`API Error (${error.status}):`, error.message);
    console.error("Error details:", error.payload);
  }
}

TypeScript Support

The client is written in TypeScript and provides full type safety:

import type { AddContentInput, ProcessInput } from "@repo/search-react";

// Input types are fully typed
const input: AddContentInput = {
  url: "https://example.com",
  doCrawl: true,
  content: "Optional content...",
};

API Reference

RagRabbitAPI.create(baseUrl: string, apiKey: string)

Creates a new API client instance.

addContent(input: AddContentInput)

Adds new content for indexing.

Parameters:

  • url: The URL to index
  • doCrawl: Whether to crawl the URL (default: false)
  • content: Optional content to index directly

runProcessing(input?: ProcessInput)

Triggers processing of content.

Parameters:

  • url: Optional URL to process specifically. If not provided, processes all pending content.