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

@promptforgee/react

v0.1.3

Published

PromptForge react package

Downloads

407

Readme


Why this package exists

Integrating dynamic prompts into React applications often involves managing complex state, handling loading states during LLM calls, and syncing context data (like user profiles or current page state) into prompts.

@promptforgee/react bridges the gap between @promptforgee/core and React. It will provide specialized hooks to build, update, and validate prompts responsively, along with headless UI components for prompt debugging and visualization.

[!WARNING]
This package is currently in early development. The APIs described below are planned features.

Features

  • 🚧 usePrompt() Hook: Reactively build prompts based on component state.
  • 🚧 Context Syncing: Automatically inject React Context values into your prompts.
  • 🚧 Headless UI Components: Render prompt diagnostic reports directly in your app.
  • 🚧 Suspense Support: Seamless integration with React Suspense for LLM streaming states.

Installation

# npm
npm install @promptforgee/react

# pnpm
pnpm add @promptforgee/react

# yarn
yarn add @promptforgee/react

# bun
bun add @promptforgee/react

Quick Start

import { hello } from '@promptforgee/react';

// Currently exports a placeholder testing function.
console.log(hello());
// Outputs: "Hello from @promptforgee/react"

API Overview

Current API

| Export | Description | | --------- | ------------------------------------------------ | | hello() | A placeholder function ensuring package linking. |

🚧 Planned API

| Export | Description | | ---------------------------- | --------------------------------------------------------------------- | | 🚧 usePrompt(initialState) | Hook to manage a Prompt builder instance with React state. | | 🚧 PromptProvider | React Context provider to share base contexts globally. | | 🚧 PromptDebugger | A headless component that renders an @promptforgee/analyzer report. |

Real-world Example (🚧 Planned)

The following code demonstrates how we envision this package being used in the future:

import { usePrompt } from '@promptforgee/react';
import { useUser } from './hooks/useUser';

export function EmailGenerator() {
  const { user } = useUser();
  const [topic, setTopic] = useState('');

  // 🚧 Planned hook usage
  const prompt = usePrompt()
    .role('Assistant')
    .task(`Write an email about: ${topic}`)
    .context(`User Name: ${user.name}`);

  const handleGenerate = async () => {
    const promptString = prompt.build();
    // await runLLM(promptString)...
  };

  return (
    <div>
      <input value={topic} onChange={(e) => setTopic(e.target.value)} />
      <button onClick={handleGenerate}>Generate</button>
    </div>
  );
}

Ecosystem

@promptforgee/react will serve as the presentation layer for PromptForge.

@promptforgee/core (Builds the underlying prompt) ↓ @promptforgee/react (You are here)

Documentation

For full documentation and advanced usage, visit promptforge.dev/docs/react.

Examples

Check out our Examples directory for more real-world use cases.

Roadmap

  • 🚧 Implement usePrompt with deep state equality checks.
  • 🚧 Create the <PromptDebugger /> component.
  • 🚧 Add Next.js App Router specific hooks (useServerPrompt).

Contributing

We welcome contributions! Please read our Contributing Guide to get started.

License

MIT © Omnikon-Org